1// Copyright 2005, Google Inc.
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met:
7//
8// * Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above
11// copyright notice, this list of conditions and the following disclaimer
12// in the documentation and/or other materials provided with the
13// distribution.
14// * Neither the name of Google Inc. nor the names of its
15// contributors may be used to endorse or promote products derived from
16// this software without specific prior written permission.
17//
18// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29//
30// Author: wan@google.com (Zhanyong Wan)
31//
32// The Google C++ Testing Framework (Google Test)
33//
34// This header file defines the public API for Google Test. It should be
35// included by any test program that uses Google Test.
36//
37// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
38// leave some internal implementation details in this header file.
39// They are clearly marked by comments like this:
40//
41// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
42//
43// Such code is NOT meant to be used by a user directly, and is subject
44// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
45// program!
46//
47// Acknowledgment: Google Test borrowed the idea of automatic test
48// registration from Barthelemy Dagenais' (barthelemy@prologique.com)
49// easyUnit framework.
50
51#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
52#define GTEST_INCLUDE_GTEST_GTEST_H_
53
54#include <limits>
55#include <ostream>
56#include <vector>
57
58// Copyright 2005, Google Inc.
59// All rights reserved.
60//
61// Redistribution and use in source and binary forms, with or without
62// modification, are permitted provided that the following conditions are
63// met:
64//
65// * Redistributions of source code must retain the above copyright
66// notice, this list of conditions and the following disclaimer.
67// * Redistributions in binary form must reproduce the above
68// copyright notice, this list of conditions and the following disclaimer
69// in the documentation and/or other materials provided with the
70// distribution.
71// * Neither the name of Google Inc. nor the names of its
72// contributors may be used to endorse or promote products derived from
73// this software without specific prior written permission.
74//
75// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
76// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
77// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
78// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
79// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
80// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
81// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
82// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
83// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
84// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
85// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
86//
87// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
88//
89// The Google C++ Testing Framework (Google Test)
90//
91// This header file declares functions and macros used internally by
92// Google Test. They are subject to change without notice.
93
94#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
95#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
96
97// Copyright 2005, Google Inc.
98// All rights reserved.
99//
100// Redistribution and use in source and binary forms, with or without
101// modification, are permitted provided that the following conditions are
102// met:
103//
104// * Redistributions of source code must retain the above copyright
105// notice, this list of conditions and the following disclaimer.
106// * Redistributions in binary form must reproduce the above
107// copyright notice, this list of conditions and the following disclaimer
108// in the documentation and/or other materials provided with the
109// distribution.
110// * Neither the name of Google Inc. nor the names of its
111// contributors may be used to endorse or promote products derived from
112// this software without specific prior written permission.
113//
114// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
115// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
116// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
117// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
118// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
119// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
120// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
121// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
122// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
123// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
124// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
125//
126// Authors: wan@google.com (Zhanyong Wan)
127//
128// Low-level types and utilities for porting Google Test to various
129// platforms. They are subject to change without notice. DO NOT USE
130// THEM IN USER CODE.
131//
132// This file is fundamental to Google Test. All other Google Test source
133// files are expected to #include this. Therefore, it cannot #include
134// any other Google Test header.
135
136#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
137#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
138
139// The user can define the following macros in the build script to
140// control Google Test's behavior. If the user doesn't define a macro
141// in this list, Google Test will define it.
142//
143// GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
144// is/isn't available.
145// GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
146// are enabled.
147// GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
148// is/isn't available (some systems define
149// ::string, which is different to std::string).
150// GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
151// is/isn't available (some systems define
152// ::wstring, which is different to std::wstring).
153// GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
154// expressions are/aren't available.
155// GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
156// is/isn't available.
157// GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
158// enabled.
159// GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
160// std::wstring does/doesn't work (Google Test can
161// be used where std::wstring is unavailable).
162// GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
163// is/isn't available.
164// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
165// compiler supports Microsoft's "Structured
166// Exception Handling".
167// GTEST_HAS_STREAM_REDIRECTION
168// - Define it to 1/0 to indicate whether the
169// platform supports I/O stream redirection using
170// dup() and dup2().
171// GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
172// Test's own tr1 tuple implementation should be
173// used. Unused when the user sets
174// GTEST_HAS_TR1_TUPLE to 0.
175// GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test
176// is building in C++11/C++98 mode.
177// GTEST_LINKED_AS_SHARED_LIBRARY
178// - Define to 1 when compiling tests that use
179// Google Test as a shared library (known as
180// DLL on Windows).
181// GTEST_CREATE_SHARED_LIBRARY
182// - Define to 1 when compiling Google Test itself
183// as a shared library.
184
185// This header defines the following utilities:
186//
187// Macros indicating the current platform (defined to 1 if compiled on
188// the given platform; otherwise undefined):
189// GTEST_OS_AIX - IBM AIX
190// GTEST_OS_CYGWIN - Cygwin
191// GTEST_OS_HPUX - HP-UX
192// GTEST_OS_LINUX - Linux
193// GTEST_OS_LINUX_ANDROID - Google Android
194// GTEST_OS_MAC - Mac OS X
195// GTEST_OS_IOS - iOS
196// GTEST_OS_IOS_SIMULATOR - iOS simulator
197// GTEST_OS_NACL - Google Native Client (NaCl)
198// GTEST_OS_OPENBSD - OpenBSD
199// GTEST_OS_QNX - QNX
200// GTEST_OS_SOLARIS - Sun Solaris
201// GTEST_OS_SYMBIAN - Symbian
202// GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
203// GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
204// GTEST_OS_WINDOWS_MINGW - MinGW
205// GTEST_OS_WINDOWS_MOBILE - Windows Mobile
206// GTEST_OS_ZOS - z/OS
207//
208// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
209// most stable support. Since core members of the Google Test project
210// don't have access to other platforms, support for them may be less
211// stable. If you notice any problems on your platform, please notify
212// googletestframework@googlegroups.com (patches for fixing them are
213// even more welcome!).
214//
215// Note that it is possible that none of the GTEST_OS_* macros are defined.
216//
217// Macros indicating available Google Test features (defined to 1 if
218// the corresponding feature is supported; otherwise undefined):
219// GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
220// tests)
221// GTEST_HAS_DEATH_TEST - death tests
222// GTEST_HAS_PARAM_TEST - value-parameterized tests
223// GTEST_HAS_TYPED_TEST - typed tests
224// GTEST_HAS_TYPED_TEST_P - type-parameterized tests
225// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
226// GTEST_HAS_POSIX_RE (see above) which users can
227// define themselves.
228// GTEST_USES_SIMPLE_RE - our own simple regex is used;
229// the above two are mutually exclusive.
230// GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
231//
232// Macros for basic C++ coding:
233// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
234// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
235// variable don't have to be used.
236// GTEST_DISALLOW_ASSIGN_ - disables operator=.
237// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
238// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
239//
240// Synchronization:
241// Mutex, MutexLock, ThreadLocal, GetThreadCount()
242// - synchronization primitives.
243// GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
244// synchronization primitives have real implementations
245// and Google Test is thread-safe; or 0 otherwise.
246//
247// Template meta programming:
248// is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
249// IteratorTraits - partial implementation of std::iterator_traits, which
250// is not available in libCstd when compiled with Sun C++.
251//
252// Smart pointers:
253// scoped_ptr - as in TR2.
254//
255// Regular expressions:
256// RE - a simple regular expression class using the POSIX
257// Extended Regular Expression syntax on UNIX-like
258// platforms, or a reduced regular exception syntax on
259// other platforms, including Windows.
260//
261// Logging:
262// GTEST_LOG_() - logs messages at the specified severity level.
263// LogToStderr() - directs all log messages to stderr.
264// FlushInfoLog() - flushes informational log messages.
265//
266// Stdout and stderr capturing:
267// CaptureStdout() - starts capturing stdout.
268// GetCapturedStdout() - stops capturing stdout and returns the captured
269// string.
270// CaptureStderr() - starts capturing stderr.
271// GetCapturedStderr() - stops capturing stderr and returns the captured
272// string.
273//
274// Integer types:
275// TypeWithSize - maps an integer to a int type.
276// Int32, UInt32, Int64, UInt64, TimeInMillis
277// - integers of known sizes.
278// BiggestInt - the biggest signed integer type.
279//
280// Command-line utilities:
281// GTEST_FLAG() - references a flag.
282// GTEST_DECLARE_*() - declares a flag.
283// GTEST_DEFINE_*() - defines a flag.
284// GetInjectableArgvs() - returns the command line as a vector of strings.
285//
286// Environment variable utilities:
287// GetEnv() - gets the value of an environment variable.
288// BoolFromGTestEnv() - parses a bool environment variable.
289// Int32FromGTestEnv() - parses an Int32 environment variable.
290// StringFromGTestEnv() - parses a string environment variable.
291
292#include <ctype.h> // for isspace, etc
293#include <stddef.h> // for ptrdiff_t
294#include <stdlib.h>
295#include <stdio.h>
296#include <string.h>
297#ifndef _WIN32_WCE
298# include <sys/types.h>
299# include <sys/stat.h>
300#endif // !_WIN32_WCE
301
302#if defined __APPLE__
303# include <AvailabilityMacros.h>
304# include <TargetConditionals.h>
305#endif
306
307#include <iostream> // NOLINT
308#include <sstream> // NOLINT
309#include <string> // NOLINT
310
311#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
312#define GTEST_FLAG_PREFIX_ "gtest_"
313#define GTEST_FLAG_PREFIX_DASH_ "gtest-"
314#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
315#define GTEST_NAME_ "Google Test"
316#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
317
318// Determines the version of gcc that is used to compile this.
319#ifdef __GNUC__
320// 40302 means version 4.3.2.
321# define GTEST_GCC_VER_ \
322 (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
323#endif // __GNUC__
324
325// Determines the platform on which Google Test is compiled.
326#define GTEST_OS_CYGWIN 0
327#define GTEST_OS_SYMBIAN 0
328#define GTEST_OS_WINDOWS 0
329#define GTEST_OS_WINDOWS_MOBILE 0
330#define GTEST_OS_WINDOWS_MINGW 0
331#define GTEST_OS_WINDOWS_DESKTOP 0
332#define GTEST_OS_MAC 0
333#define GTEST_OS_LINUX 0
334#define GTEST_OS_LINUX_ANDROID 0
335#define GTEST_OS_ZOS 0
336#define GTEST_OS_SOLARIS 0
337#define GTEST_OS_AIX 0
338#define GTEST_OS_HPUX 0
339#define GTEST_OS_NACL 0
340#define GTEST_OS_OPENBSD 0
341#define GTEST_OS_QNX 0
342#define GTEST_OS_IOS 0
343#define GTEST_OS_IOS_SIMULATOR 0
344
345#ifdef __CYGWIN__
346# undef GTEST_OS_CYGWIN
347# define GTEST_OS_CYGWIN 1
348#elif defined __SYMBIAN32__
349# undef GTEST_OS_SYMBIAN
350# define GTEST_OS_SYMBIAN 1
351#elif defined _WIN32
352# undef GTEST_OS_WINDOWS
353# define GTEST_OS_WINDOWS 1
354# ifdef _WIN32_WCE
355# undef GTEST_OS_WINDOWS_MOBILE
356# define GTEST_OS_WINDOWS_MOBILE 1
357# elif defined(__MINGW__) || defined(__MINGW32__)
358# undef GTEST_OS_WINDOWS_MINGW
359# define GTEST_OS_WINDOWS_MINGW 1
360# else
361# undef GTEST_OS_WINDOWS_DESKTOP
362# define GTEST_OS_WINDOWS_DESKTOP 1
363# endif // _WIN32_WCE
364#elif defined __APPLE__
365# undef GTEST_OS_MAC
366# define GTEST_OS_MAC 1
367# if TARGET_OS_IPHONE
368# undef GTEST_OS_IOS
369# define GTEST_OS_IOS 1
370# if TARGET_IPHONE_SIMULATOR
371# undef GTEST_OS_IOS_SIMULATOR
372# define GTEST_OS_IOS_SIMULATOR 1
373# endif
374# endif
375#elif defined __linux__
376# undef GTEST_OS_LINUX
377# define GTEST_OS_LINUX 1
378# if defined __ANDROID__
379# undef GTEST_OS_LINUX_ANDROID
380# define GTEST_OS_LINUX_ANDROID 1
381# endif
382#elif defined __MVS__
383# undef GTEST_OS_ZOS
384# define GTEST_OS_ZOS 1
385#elif defined(__sun) && defined(__SVR4)
386# undef GTEST_OS_SOLARIS
387# define GTEST_OS_SOLARIS 1
388#elif defined(_AIX)
389# undef GTEST_OS_AIX
390# define GTEST_OS_AIX 1
391#elif defined(__hpux)
392# undef GTEST_OS_HPUX
393# define GTEST_OS_HPUX 1
394#elif defined __native_client__
395# undef GTEST_OS_NACL
396# define GTEST_OS_NACL 1
397#elif defined __OpenBSD__
398# undef GTEST_OS_OPENBSD
399# define GTEST_OS_OPENBSD 1
400#elif defined __QNX__
401# undef GTEST_OS_QNX
402# define GTEST_OS_QNX 1
403#endif // __CYGWIN__
404
405#ifndef GTEST_LANG_CXX11
406// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
407// -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
408// value for __cplusplus, and recent versions of clang, gcc, and
409// probably other compilers set that too in C++11 mode.
410# if defined __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
411// Compiling in at least C++11 mode.
412# define GTEST_LANG_CXX11 1
413# else
414# define GTEST_LANG_CXX11 0
415# endif
416#endif
417
418// Brings in definitions for functions used in the testing::internal::posix
419// namespace (read, write, close, chdir, isatty, stat). We do not currently
420// use them on Windows Mobile.
421#if !GTEST_OS_WINDOWS
422// This assumes that non-Windows OSes provide unistd.h. For OSes where this
423// is not the case, we need to include headers that provide the functions
424// mentioned above.
425# include <unistd.h>
426# include <strings.h>
427#elif !GTEST_OS_WINDOWS_MOBILE
428# include <direct.h>
429# include <io.h>
430#endif
431
432#if GTEST_OS_LINUX_ANDROID
433// Used to define __ANDROID_API__ matching the target NDK API level.
434# include <android/api-level.h> // NOLINT
435#endif
436
437// Defines this to true iff Google Test can use POSIX regular expressions.
438#ifndef GTEST_HAS_POSIX_RE
439# if GTEST_OS_LINUX_ANDROID
440// On Android, <regex.h> is only available starting with Froyo.
441# define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 8)
442# else
443# define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
444#endif
445#endif
446
447#if GTEST_HAS_POSIX_RE
448
449// On some platforms, <regex.h> needs someone to define size_t, and
450// won't compile otherwise. We can #include it here as we already
451// included <stdlib.h>, which is guaranteed to define size_t through
452// <stddef.h>.
453# include <regex.h> // NOLINT
454
455# define GTEST_USES_POSIX_RE 1
456# define GTEST_USES_SIMPLE_RE 0
457
458#elif GTEST_OS_WINDOWS
459
460// <regex.h> is not available on Windows. Use our own simple regex
461// implementation instead.
462# define GTEST_USES_SIMPLE_RE 1
463# define GTEST_USES_POSIX_RE 0
464
465#else
466
467// <regex.h> may not be available on this platform. Use our own
468// simple regex implementation instead.
469# define GTEST_USES_SIMPLE_RE 1
470# define GTEST_USES_POSIX_RE 0
471
472#endif // GTEST_HAS_POSIX_RE
473
474#ifndef GTEST_HAS_EXCEPTIONS
475// The user didn't tell us whether exceptions are enabled, so we need
476// to figure it out.
477# if defined(_MSC_VER) || defined(__BORLANDC__)
478// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
479// macro to enable exceptions, so we'll do the same.
480// Assumes that exceptions are enabled by default.
481# ifndef _HAS_EXCEPTIONS
482# define _HAS_EXCEPTIONS 1
483# endif // _HAS_EXCEPTIONS
484# define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
485# elif defined(__GNUC__) && __EXCEPTIONS
486// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
487# define GTEST_HAS_EXCEPTIONS 1
488# elif defined(__SUNPRO_CC)
489// Sun Pro CC supports exceptions. However, there is no compile-time way of
490// detecting whether they are enabled or not. Therefore, we assume that
491// they are enabled unless the user tells us otherwise.
492# define GTEST_HAS_EXCEPTIONS 1
493# elif defined(__IBMCPP__) && __EXCEPTIONS
494// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
495# define GTEST_HAS_EXCEPTIONS 1
496# elif defined(__HP_aCC)
497// Exception handling is in effect by default in HP aCC compiler. It has to
498// be turned of by +noeh compiler option if desired.
499# define GTEST_HAS_EXCEPTIONS 1
500# else
501// For other compilers, we assume exceptions are disabled to be
502// conservative.
503# define GTEST_HAS_EXCEPTIONS 0
504# endif // defined(_MSC_VER) || defined(__BORLANDC__)
505#endif // GTEST_HAS_EXCEPTIONS
506
507#if !defined(GTEST_HAS_STD_STRING)
508// Even though we don't use this macro any longer, we keep it in case
509// some clients still depend on it.
510# define GTEST_HAS_STD_STRING 1
511#elif !GTEST_HAS_STD_STRING
512// The user told us that ::std::string isn't available.
513# error "Google Test cannot be used where ::std::string isn't available."
514#endif // !defined(GTEST_HAS_STD_STRING)
515
516#ifndef GTEST_HAS_GLOBAL_STRING
517// The user didn't tell us whether ::string is available, so we need
518// to figure it out.
519
520# define GTEST_HAS_GLOBAL_STRING 0
521
522#endif // GTEST_HAS_GLOBAL_STRING
523
524#ifndef GTEST_HAS_STD_WSTRING
525// The user didn't tell us whether ::std::wstring is available, so we need
526// to figure it out.
527// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
528// is available.
529
530// Cygwin 1.7 and below doesn't support ::std::wstring.
531// Solaris' libc++ doesn't support it either. Android has
532// no support for it at least as recent as Froyo (2.2).
533# define GTEST_HAS_STD_WSTRING \
534 (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
535
536#endif // GTEST_HAS_STD_WSTRING
537
538#ifndef GTEST_HAS_GLOBAL_WSTRING
539// The user didn't tell us whether ::wstring is available, so we need
540// to figure it out.
541# define GTEST_HAS_GLOBAL_WSTRING \
542 (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
543#endif // GTEST_HAS_GLOBAL_WSTRING
544
545// Determines whether RTTI is available.
546#ifndef GTEST_HAS_RTTI
547// The user didn't tell us whether RTTI is enabled, so we need to
548// figure it out.
549
550# ifdef _MSC_VER
551
552# ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
553# define GTEST_HAS_RTTI 1
554# else
555# define GTEST_HAS_RTTI 0
556# endif
557
558// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
559# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
560
561# ifdef __GXX_RTTI
562// When building against STLport with the Android NDK and with
563// -frtti -fno-exceptions, the build fails at link time with undefined
564// references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
565// so disable RTTI when detected.
566# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
567 !defined(__EXCEPTIONS)
568# define GTEST_HAS_RTTI 0
569# else
570# define GTEST_HAS_RTTI 1
571# endif // GTEST_OS_LINUX_ANDROID && _STLPORT_MAJOR && !__EXCEPTIONS
572# else
573# define GTEST_HAS_RTTI 0
574# endif // __GXX_RTTI
575
576// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
577// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
578// first version with C++ support.
579# elif defined(__clang__)
580
581# define GTEST_HAS_RTTI __has_feature(cxx_rtti)
582
583// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
584// both the typeid and dynamic_cast features are present.
585# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
586
587# ifdef __RTTI_ALL__
588# define GTEST_HAS_RTTI 1
589# else
590# define GTEST_HAS_RTTI 0
591# endif
592
593# else
594
595// For all other compilers, we assume RTTI is enabled.
596# define GTEST_HAS_RTTI 1
597
598# endif // _MSC_VER
599
600#endif // GTEST_HAS_RTTI
601
602// It's this header's responsibility to #include <typeinfo> when RTTI
603// is enabled.
604#if GTEST_HAS_RTTI
605# include <typeinfo>
606#endif
607
608// Determines whether Google Test can use the pthreads library.
609#ifndef GTEST_HAS_PTHREAD
610// The user didn't tell us explicitly, so we assume pthreads support is
611// available on Linux and Mac.
612//
613// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
614// to your compiler flags.
615# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
616 || GTEST_OS_QNX)
617#endif // GTEST_HAS_PTHREAD
618
619#if GTEST_HAS_PTHREAD
620// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
621// true.
622# include <pthread.h> // NOLINT
623
624// For timespec and nanosleep, used below.
625# include <time.h> // NOLINT
626#endif
627
628// Determines whether Google Test can use tr1/tuple. You can define
629// this macro to 0 to prevent Google Test from using tuple (any
630// feature depending on tuple with be disabled in this mode).
631#ifndef GTEST_HAS_TR1_TUPLE
632# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
633// STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
634# define GTEST_HAS_TR1_TUPLE 0
635# else
636// The user didn't tell us not to do it, so we assume it's OK.
637# define GTEST_HAS_TR1_TUPLE 1
638# endif
639#endif // GTEST_HAS_TR1_TUPLE
640
641// Determines whether Google Test's own tr1 tuple implementation
642// should be used.
643#ifndef GTEST_USE_OWN_TR1_TUPLE
644// The user didn't tell us, so we need to figure it out.
645
646// We use our own TR1 tuple if we aren't sure the user has an
647// implementation of it already. At this time, libstdc++ 4.0.0+ and
648// MSVC 2010 are the only mainstream standard libraries that come
649// with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler
650// pretends to be GCC by defining __GNUC__ and friends, but cannot
651// compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1
652// tuple in a 323 MB Feature Pack download, which we cannot assume the
653// user has. QNX's QCC compiler is a modified GCC but it doesn't
654// support TR1 tuple. libc++ only provides std::tuple, in C++11 mode,
655// and it can be used with some compilers that define __GNUC__.
656# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
657 && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) && !defined(_STLPORT_MAJOR) \
658 || (defined(_MSC_VER) && _MSC_VER >= 1600)
659# define GTEST_ENV_HAS_TR1_TUPLE_ 1
660# else
661# define GTEST_ENV_HAS_TR1_TUPLE_ 0
662# endif
663
664// C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
665// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
666// can build with clang but need to use gcc4.2's libstdc++).
667# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
668# define GTEST_ENV_HAS_STD_TUPLE_ 1
669# else
670# define GTEST_ENV_HAS_STD_TUPLE_ 0
671# endif
672
673# if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
674# define GTEST_USE_OWN_TR1_TUPLE 0
675# else
676# define GTEST_USE_OWN_TR1_TUPLE 1
677# undef GTEST_HAS_TR1_TUPLE
678# define GTEST_HAS_TR1_TUPLE 1
679# endif
680
681#endif // GTEST_USE_OWN_TR1_TUPLE
682
683// To avoid conditional compilation everywhere, we make it
684// gtest-port.h's responsibility to #include the header implementing
685// tr1/tuple.
686#if GTEST_HAS_TR1_TUPLE
687
688# if GTEST_USE_OWN_TR1_TUPLE
689// This file was GENERATED by command:
690// pump.py gtest-tuple.h.pump
691// DO NOT EDIT BY HAND!!!
692
693// Copyright 2009 Google Inc.
694// All Rights Reserved.
695//
696// Redistribution and use in source and binary forms, with or without
697// modification, are permitted provided that the following conditions are
698// met:
699//
700// * Redistributions of source code must retain the above copyright
701// notice, this list of conditions and the following disclaimer.
702// * Redistributions in binary form must reproduce the above
703// copyright notice, this list of conditions and the following disclaimer
704// in the documentation and/or other materials provided with the
705// distribution.
706// * Neither the name of Google Inc. nor the names of its
707// contributors may be used to endorse or promote products derived from
708// this software without specific prior written permission.
709//
710// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
711// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
712// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
713// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
714// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
715// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
716// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
717// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
718// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
719// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
720// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
721//
722// Author: wan@google.com (Zhanyong Wan)
723
724// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
725
726#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
727#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
728
729#include <utility> // For ::std::pair.
730
731// The compiler used in Symbian has a bug that prevents us from declaring the
732// tuple template as a friend (it complains that tuple is redefined). This
733// hack bypasses the bug by declaring the members that should otherwise be
734// private as public.
735// Sun Studio versions < 12 also have the above bug.
736#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
737# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
738#else
739# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
740 template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
741 private:
742#endif
743
744// GTEST_n_TUPLE_(T) is the type of an n-tuple.
745#define GTEST_0_TUPLE_(T) tuple<>
746#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
747 void, void, void>
748#define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
749 void, void, void>
750#define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
751 void, void, void>
752#define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
753 void, void, void>
754#define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
755 void, void, void>
756#define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
757 void, void, void>
758#define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
759 void, void, void>
760#define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
761 T##7, void, void>
762#define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
763 T##7, T##8, void>
764#define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
765 T##7, T##8, T##9>
766
767// GTEST_n_TYPENAMES_(T) declares a list of n typenames.
768#define GTEST_0_TYPENAMES_(T)
769#define GTEST_1_TYPENAMES_(T) typename T##0
770#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
771#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
772#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
773 typename T##3
774#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
775 typename T##3, typename T##4
776#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
777 typename T##3, typename T##4, typename T##5
778#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
779 typename T##3, typename T##4, typename T##5, typename T##6
780#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
781 typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
782#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
783 typename T##3, typename T##4, typename T##5, typename T##6, \
784 typename T##7, typename T##8
785#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
786 typename T##3, typename T##4, typename T##5, typename T##6, \
787 typename T##7, typename T##8, typename T##9
788
789// In theory, defining stuff in the ::std namespace is undefined
790// behavior. We can do this as we are playing the role of a standard
791// library vendor.
792namespace std {
793namespace tr1 {
794
795template <typename T0 = void, typename T1 = void, typename T2 = void,
796 typename T3 = void, typename T4 = void, typename T5 = void,
797 typename T6 = void, typename T7 = void, typename T8 = void,
798 typename T9 = void>
799class tuple;
800
801// Anything in namespace gtest_internal is Google Test's INTERNAL
802// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
803namespace gtest_internal {
804
805// ByRef<T>::type is T if T is a reference; otherwise it's const T&.
806template <typename T>
807struct ByRef { typedef const T& type; }; // NOLINT
808template <typename T>
809struct ByRef<T&> { typedef T& type; }; // NOLINT
810
811// A handy wrapper for ByRef.
812#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
813
814// AddRef<T>::type is T if T is a reference; otherwise it's T&. This
815// is the same as tr1::add_reference<T>::type.
816template <typename T>
817struct AddRef { typedef T& type; }; // NOLINT
818template <typename T>
819struct AddRef<T&> { typedef T& type; }; // NOLINT
820
821// A handy wrapper for AddRef.
822#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
823
824// A helper for implementing get<k>().
825template <int k> class Get;
826
827// A helper for implementing tuple_element<k, T>. kIndexValid is true
828// iff k < the number of fields in tuple type T.
829template <bool kIndexValid, int kIndex, class Tuple>
830struct TupleElement;
831
832template <GTEST_10_TYPENAMES_(T)>
833struct TupleElement<true, 0, GTEST_10_TUPLE_(T)> {
834 typedef T0 type;
835};
836
837template <GTEST_10_TYPENAMES_(T)>
838struct TupleElement<true, 1, GTEST_10_TUPLE_(T)> {
839 typedef T1 type;
840};
841
842template <GTEST_10_TYPENAMES_(T)>
843struct TupleElement<true, 2, GTEST_10_TUPLE_(T)> {
844 typedef T2 type;
845};
846
847template <GTEST_10_TYPENAMES_(T)>
848struct TupleElement<true, 3, GTEST_10_TUPLE_(T)> {
849 typedef T3 type;
850};
851
852template <GTEST_10_TYPENAMES_(T)>
853struct TupleElement<true, 4, GTEST_10_TUPLE_(T)> {
854 typedef T4 type;
855};
856
857template <GTEST_10_TYPENAMES_(T)>
858struct TupleElement<true, 5, GTEST_10_TUPLE_(T)> {
859 typedef T5 type;
860};
861
862template <GTEST_10_TYPENAMES_(T)>
863struct TupleElement<true, 6, GTEST_10_TUPLE_(T)> {
864 typedef T6 type;
865};
866
867template <GTEST_10_TYPENAMES_(T)>
868struct TupleElement<true, 7, GTEST_10_TUPLE_(T)> {
869 typedef T7 type;
870};
871
872template <GTEST_10_TYPENAMES_(T)>
873struct TupleElement<true, 8, GTEST_10_TUPLE_(T)> {
874 typedef T8 type;
875};
876
877template <GTEST_10_TYPENAMES_(T)>
878struct TupleElement<true, 9, GTEST_10_TUPLE_(T)> {
879 typedef T9 type;
880};
881
882} // namespace gtest_internal
883
884template <>
885class tuple<> {
886 public:
887 tuple() {}
888 tuple(const tuple& /* t */) {}
889 tuple& operator=(const tuple& /* t */) { return *this; }
890};
891
892template <GTEST_1_TYPENAMES_(T)>
893class GTEST_1_TUPLE_(T) {
894 public:
895 template <int k> friend class gtest_internal::Get;
896
897 tuple() : f0_() {}
898
899 explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
900
901 tuple(const tuple& t) : f0_(t.f0_) {}
902
903 template <GTEST_1_TYPENAMES_(U)>
904 tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
905
906 tuple& operator=(const tuple& t) { return CopyFrom(t); }
907
908 template <GTEST_1_TYPENAMES_(U)>
909 tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
910 return CopyFrom(t);
911 }
912
913 GTEST_DECLARE_TUPLE_AS_FRIEND_
914
915 template <GTEST_1_TYPENAMES_(U)>
916 tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
917 f0_ = t.f0_;
918 return *this;
919 }
920
921 T0 f0_;
922};
923
924template <GTEST_2_TYPENAMES_(T)>
925class GTEST_2_TUPLE_(T) {
926 public:
927 template <int k> friend class gtest_internal::Get;
928
929 tuple() : f0_(), f1_() {}
930
931 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
932 f1_(f1) {}
933
934 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
935
936 template <GTEST_2_TYPENAMES_(U)>
937 tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
938 template <typename U0, typename U1>
939 tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
940
941 tuple& operator=(const tuple& t) { return CopyFrom(t); }
942
943 template <GTEST_2_TYPENAMES_(U)>
944 tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
945 return CopyFrom(t);
946 }
947 template <typename U0, typename U1>
948 tuple& operator=(const ::std::pair<U0, U1>& p) {
949 f0_ = p.first;
950 f1_ = p.second;
951 return *this;
952 }
953
954 GTEST_DECLARE_TUPLE_AS_FRIEND_
955
956 template <GTEST_2_TYPENAMES_(U)>
957 tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
958 f0_ = t.f0_;
959 f1_ = t.f1_;
960 return *this;
961 }
962
963 T0 f0_;
964 T1 f1_;
965};
966
967template <GTEST_3_TYPENAMES_(T)>
968class GTEST_3_TUPLE_(T) {
969 public:
970 template <int k> friend class gtest_internal::Get;
971
972 tuple() : f0_(), f1_(), f2_() {}
973
974 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
975 GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
976
977 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
978
979 template <GTEST_3_TYPENAMES_(U)>
980 tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
981
982 tuple& operator=(const tuple& t) { return CopyFrom(t); }
983
984 template <GTEST_3_TYPENAMES_(U)>
985 tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
986 return CopyFrom(t);
987 }
988
989 GTEST_DECLARE_TUPLE_AS_FRIEND_
990
991 template <GTEST_3_TYPENAMES_(U)>
992 tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
993 f0_ = t.f0_;
994 f1_ = t.f1_;
995 f2_ = t.f2_;
996 return *this;
997 }
998
999 T0 f0_;
1000 T1 f1_;
1001 T2 f2_;
1002};
1003
1004template <GTEST_4_TYPENAMES_(T)>
1005class GTEST_4_TUPLE_(T) {
1006 public:
1007 template <int k> friend class gtest_internal::Get;
1008
1009 tuple() : f0_(), f1_(), f2_(), f3_() {}
1010
1011 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1012 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
1013 f3_(f3) {}
1014
1015 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
1016
1017 template <GTEST_4_TYPENAMES_(U)>
1018 tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1019 f3_(t.f3_) {}
1020
1021 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1022
1023 template <GTEST_4_TYPENAMES_(U)>
1024 tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
1025 return CopyFrom(t);
1026 }
1027
1028 GTEST_DECLARE_TUPLE_AS_FRIEND_
1029
1030 template <GTEST_4_TYPENAMES_(U)>
1031 tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
1032 f0_ = t.f0_;
1033 f1_ = t.f1_;
1034 f2_ = t.f2_;
1035 f3_ = t.f3_;
1036 return *this;
1037 }
1038
1039 T0 f0_;
1040 T1 f1_;
1041 T2 f2_;
1042 T3 f3_;
1043};
1044
1045template <GTEST_5_TYPENAMES_(T)>
1046class GTEST_5_TUPLE_(T) {
1047 public:
1048 template <int k> friend class gtest_internal::Get;
1049
1050 tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
1051
1052 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1053 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
1054 GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
1055
1056 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1057 f4_(t.f4_) {}
1058
1059 template <GTEST_5_TYPENAMES_(U)>
1060 tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1061 f3_(t.f3_), f4_(t.f4_) {}
1062
1063 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1064
1065 template <GTEST_5_TYPENAMES_(U)>
1066 tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
1067 return CopyFrom(t);
1068 }
1069
1070 GTEST_DECLARE_TUPLE_AS_FRIEND_
1071
1072 template <GTEST_5_TYPENAMES_(U)>
1073 tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
1074 f0_ = t.f0_;
1075 f1_ = t.f1_;
1076 f2_ = t.f2_;
1077 f3_ = t.f3_;
1078 f4_ = t.f4_;
1079 return *this;
1080 }
1081
1082 T0 f0_;
1083 T1 f1_;
1084 T2 f2_;
1085 T3 f3_;
1086 T4 f4_;
1087};
1088
1089template <GTEST_6_TYPENAMES_(T)>
1090class GTEST_6_TUPLE_(T) {
1091 public:
1092 template <int k> friend class gtest_internal::Get;
1093
1094 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
1095
1096 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1097 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1098 GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1099 f5_(f5) {}
1100
1101 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1102 f4_(t.f4_), f5_(t.f5_) {}
1103
1104 template <GTEST_6_TYPENAMES_(U)>
1105 tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1106 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
1107
1108 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1109
1110 template <GTEST_6_TYPENAMES_(U)>
1111 tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
1112 return CopyFrom(t);
1113 }
1114
1115 GTEST_DECLARE_TUPLE_AS_FRIEND_
1116
1117 template <GTEST_6_TYPENAMES_(U)>
1118 tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
1119 f0_ = t.f0_;
1120 f1_ = t.f1_;
1121 f2_ = t.f2_;
1122 f3_ = t.f3_;
1123 f4_ = t.f4_;
1124 f5_ = t.f5_;
1125 return *this;
1126 }
1127
1128 T0 f0_;
1129 T1 f1_;
1130 T2 f2_;
1131 T3 f3_;
1132 T4 f4_;
1133 T5 f5_;
1134};
1135
1136template <GTEST_7_TYPENAMES_(T)>
1137class GTEST_7_TUPLE_(T) {
1138 public:
1139 template <int k> friend class gtest_internal::Get;
1140
1141 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
1142
1143 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1144 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1145 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
1146 f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
1147
1148 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1149 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1150
1151 template <GTEST_7_TYPENAMES_(U)>
1152 tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1153 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1154
1155 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1156
1157 template <GTEST_7_TYPENAMES_(U)>
1158 tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
1159 return CopyFrom(t);
1160 }
1161
1162 GTEST_DECLARE_TUPLE_AS_FRIEND_
1163
1164 template <GTEST_7_TYPENAMES_(U)>
1165 tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
1166 f0_ = t.f0_;
1167 f1_ = t.f1_;
1168 f2_ = t.f2_;
1169 f3_ = t.f3_;
1170 f4_ = t.f4_;
1171 f5_ = t.f5_;
1172 f6_ = t.f6_;
1173 return *this;
1174 }
1175
1176 T0 f0_;
1177 T1 f1_;
1178 T2 f2_;
1179 T3 f3_;
1180 T4 f4_;
1181 T5 f5_;
1182 T6 f6_;
1183};
1184
1185template <GTEST_8_TYPENAMES_(T)>
1186class GTEST_8_TUPLE_(T) {
1187 public:
1188 template <int k> friend class gtest_internal::Get;
1189
1190 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
1191
1192 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1193 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1194 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
1195 GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1196 f5_(f5), f6_(f6), f7_(f7) {}
1197
1198 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1199 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1200
1201 template <GTEST_8_TYPENAMES_(U)>
1202 tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1203 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1204
1205 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1206
1207 template <GTEST_8_TYPENAMES_(U)>
1208 tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
1209 return CopyFrom(t);
1210 }
1211
1212 GTEST_DECLARE_TUPLE_AS_FRIEND_
1213
1214 template <GTEST_8_TYPENAMES_(U)>
1215 tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
1216 f0_ = t.f0_;
1217 f1_ = t.f1_;
1218 f2_ = t.f2_;
1219 f3_ = t.f3_;
1220 f4_ = t.f4_;
1221 f5_ = t.f5_;
1222 f6_ = t.f6_;
1223 f7_ = t.f7_;
1224 return *this;
1225 }
1226
1227 T0 f0_;
1228 T1 f1_;
1229 T2 f2_;
1230 T3 f3_;
1231 T4 f4_;
1232 T5 f5_;
1233 T6 f6_;
1234 T7 f7_;
1235};
1236
1237template <GTEST_9_TYPENAMES_(T)>
1238class GTEST_9_TUPLE_(T) {
1239 public:
1240 template <int k> friend class gtest_internal::Get;
1241
1242 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
1243
1244 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1245 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1246 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1247 GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1248 f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
1249
1250 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1251 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1252
1253 template <GTEST_9_TYPENAMES_(U)>
1254 tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1255 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1256
1257 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1258
1259 template <GTEST_9_TYPENAMES_(U)>
1260 tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
1261 return CopyFrom(t);
1262 }
1263
1264 GTEST_DECLARE_TUPLE_AS_FRIEND_
1265
1266 template <GTEST_9_TYPENAMES_(U)>
1267 tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
1268 f0_ = t.f0_;
1269 f1_ = t.f1_;
1270 f2_ = t.f2_;
1271 f3_ = t.f3_;
1272 f4_ = t.f4_;
1273 f5_ = t.f5_;
1274 f6_ = t.f6_;
1275 f7_ = t.f7_;
1276 f8_ = t.f8_;
1277 return *this;
1278 }
1279
1280 T0 f0_;
1281 T1 f1_;
1282 T2 f2_;
1283 T3 f3_;
1284 T4 f4_;
1285 T5 f5_;
1286 T6 f6_;
1287 T7 f7_;
1288 T8 f8_;
1289};
1290
1291template <GTEST_10_TYPENAMES_(T)>
1292class tuple {
1293 public:
1294 template <int k> friend class gtest_internal::Get;
1295
1296 tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
1297 f9_() {}
1298
1299 explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1300 GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1301 GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1302 GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
1303 f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
1304
1305 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1306 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
1307
1308 template <GTEST_10_TYPENAMES_(U)>
1309 tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1310 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
1311 f9_(t.f9_) {}
1312
1313 tuple& operator=(const tuple& t) { return CopyFrom(t); }
1314
1315 template <GTEST_10_TYPENAMES_(U)>
1316 tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
1317 return CopyFrom(t);
1318 }
1319
1320 GTEST_DECLARE_TUPLE_AS_FRIEND_
1321
1322 template <GTEST_10_TYPENAMES_(U)>
1323 tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
1324 f0_ = t.f0_;
1325 f1_ = t.f1_;
1326 f2_ = t.f2_;
1327 f3_ = t.f3_;
1328 f4_ = t.f4_;
1329 f5_ = t.f5_;
1330 f6_ = t.f6_;
1331 f7_ = t.f7_;
1332 f8_ = t.f8_;
1333 f9_ = t.f9_;
1334 return *this;
1335 }
1336
1337 T0 f0_;
1338 T1 f1_;
1339 T2 f2_;
1340 T3 f3_;
1341 T4 f4_;
1342 T5 f5_;
1343 T6 f6_;
1344 T7 f7_;
1345 T8 f8_;
1346 T9 f9_;
1347};
1348
1349// 6.1.3.2 Tuple creation functions.
1350
1351// Known limitations: we don't support passing an
1352// std::tr1::reference_wrapper<T> to make_tuple(). And we don't
1353// implement tie().
1354
1355inline tuple<> make_tuple() { return tuple<>(); }
1356
1357template <GTEST_1_TYPENAMES_(T)>
1358inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
1359 return GTEST_1_TUPLE_(T)(f0);
1360}
1361
1362template <GTEST_2_TYPENAMES_(T)>
1363inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
1364 return GTEST_2_TUPLE_(T)(f0, f1);
1365}
1366
1367template <GTEST_3_TYPENAMES_(T)>
1368inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
1369 return GTEST_3_TUPLE_(T)(f0, f1, f2);
1370}
1371
1372template <GTEST_4_TYPENAMES_(T)>
1373inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1374 const T3& f3) {
1375 return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
1376}
1377
1378template <GTEST_5_TYPENAMES_(T)>
1379inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1380 const T3& f3, const T4& f4) {
1381 return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
1382}
1383
1384template <GTEST_6_TYPENAMES_(T)>
1385inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1386 const T3& f3, const T4& f4, const T5& f5) {
1387 return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
1388}
1389
1390template <GTEST_7_TYPENAMES_(T)>
1391inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1392 const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
1393 return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
1394}
1395
1396template <GTEST_8_TYPENAMES_(T)>
1397inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1398 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
1399 return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
1400}
1401
1402template <GTEST_9_TYPENAMES_(T)>
1403inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1404 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1405 const T8& f8) {
1406 return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
1407}
1408
1409template <GTEST_10_TYPENAMES_(T)>
1410inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1411 const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1412 const T8& f8, const T9& f9) {
1413 return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
1414}
1415
1416// 6.1.3.3 Tuple helper classes.
1417
1418template <typename Tuple> struct tuple_size;
1419
1420template <GTEST_0_TYPENAMES_(T)>
1421struct tuple_size<GTEST_0_TUPLE_(T)> {
1422 static const int value = 0;
1423};
1424
1425template <GTEST_1_TYPENAMES_(T)>
1426struct tuple_size<GTEST_1_TUPLE_(T)> {
1427 static const int value = 1;
1428};
1429
1430template <GTEST_2_TYPENAMES_(T)>
1431struct tuple_size<GTEST_2_TUPLE_(T)> {
1432 static const int value = 2;
1433};
1434
1435template <GTEST_3_TYPENAMES_(T)>
1436struct tuple_size<GTEST_3_TUPLE_(T)> {
1437 static const int value = 3;
1438};
1439
1440template <GTEST_4_TYPENAMES_(T)>
1441struct tuple_size<GTEST_4_TUPLE_(T)> {
1442 static const int value = 4;
1443};
1444
1445template <GTEST_5_TYPENAMES_(T)>
1446struct tuple_size<GTEST_5_TUPLE_(T)> {
1447 static const int value = 5;
1448};
1449
1450template <GTEST_6_TYPENAMES_(T)>
1451struct tuple_size<GTEST_6_TUPLE_(T)> {
1452 static const int value = 6;
1453};
1454
1455template <GTEST_7_TYPENAMES_(T)>
1456struct tuple_size<GTEST_7_TUPLE_(T)> {
1457 static const int value = 7;
1458};
1459
1460template <GTEST_8_TYPENAMES_(T)>
1461struct tuple_size<GTEST_8_TUPLE_(T)> {
1462 static const int value = 8;
1463};
1464
1465template <GTEST_9_TYPENAMES_(T)>
1466struct tuple_size<GTEST_9_TUPLE_(T)> {
1467 static const int value = 9;
1468};
1469
1470template <GTEST_10_TYPENAMES_(T)>
1471struct tuple_size<GTEST_10_TUPLE_(T)> {
1472 static const int value = 10;
1473};
1474
1475template <int k, class Tuple>
1476struct tuple_element {
1477 typedef typename gtest_internal::TupleElement<
1478 k < (tuple_size<Tuple>::value), k, Tuple>::type type;
1479};
1480
1481#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
1482
1483// 6.1.3.4 Element access.
1484
1485namespace gtest_internal {
1486
1487template <>
1488class Get<0> {
1489 public:
1490 template <class Tuple>
1491 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1492 Field(Tuple& t) { return t.f0_; } // NOLINT
1493
1494 template <class Tuple>
1495 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1496 ConstField(const Tuple& t) { return t.f0_; }
1497};
1498
1499template <>
1500class Get<1> {
1501 public:
1502 template <class Tuple>
1503 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1504 Field(Tuple& t) { return t.f1_; } // NOLINT
1505
1506 template <class Tuple>
1507 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1508 ConstField(const Tuple& t) { return t.f1_; }
1509};
1510
1511template <>
1512class Get<2> {
1513 public:
1514 template <class Tuple>
1515 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1516 Field(Tuple& t) { return t.f2_; } // NOLINT
1517
1518 template <class Tuple>
1519 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1520 ConstField(const Tuple& t) { return t.f2_; }
1521};
1522
1523template <>
1524class Get<3> {
1525 public:
1526 template <class Tuple>
1527 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1528 Field(Tuple& t) { return t.f3_; } // NOLINT
1529
1530 template <class Tuple>
1531 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1532 ConstField(const Tuple& t) { return t.f3_; }
1533};
1534
1535template <>
1536class Get<4> {
1537 public:
1538 template <class Tuple>
1539 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1540 Field(Tuple& t) { return t.f4_; } // NOLINT
1541
1542 template <class Tuple>
1543 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1544 ConstField(const Tuple& t) { return t.f4_; }
1545};
1546
1547template <>
1548class Get<5> {
1549 public:
1550 template <class Tuple>
1551 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1552 Field(Tuple& t) { return t.f5_; } // NOLINT
1553
1554 template <class Tuple>
1555 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1556 ConstField(const Tuple& t) { return t.f5_; }
1557};
1558
1559template <>
1560class Get<6> {
1561 public:
1562 template <class Tuple>
1563 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1564 Field(Tuple& t) { return t.f6_; } // NOLINT
1565
1566 template <class Tuple>
1567 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1568 ConstField(const Tuple& t) { return t.f6_; }
1569};
1570
1571template <>
1572class Get<7> {
1573 public:
1574 template <class Tuple>
1575 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1576 Field(Tuple& t) { return t.f7_; } // NOLINT
1577
1578 template <class Tuple>
1579 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1580 ConstField(const Tuple& t) { return t.f7_; }
1581};
1582
1583template <>
1584class Get<8> {
1585 public:
1586 template <class Tuple>
1587 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1588 Field(Tuple& t) { return t.f8_; } // NOLINT
1589
1590 template <class Tuple>
1591 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1592 ConstField(const Tuple& t) { return t.f8_; }
1593};
1594
1595template <>
1596class Get<9> {
1597 public:
1598 template <class Tuple>
1599 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1600 Field(Tuple& t) { return t.f9_; } // NOLINT
1601
1602 template <class Tuple>
1603 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1604 ConstField(const Tuple& t) { return t.f9_; }
1605};
1606
1607} // namespace gtest_internal
1608
1609template <int k, GTEST_10_TYPENAMES_(T)>
1610GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1611get(GTEST_10_TUPLE_(T)& t) {
1612 return gtest_internal::Get<k>::Field(t);
1613}
1614
1615template <int k, GTEST_10_TYPENAMES_(T)>
1616GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1617get(const GTEST_10_TUPLE_(T)& t) {
1618 return gtest_internal::Get<k>::ConstField(t);
1619}
1620
1621// 6.1.3.5 Relational operators
1622
1623// We only implement == and !=, as we don't have a need for the rest yet.
1624
1625namespace gtest_internal {
1626
1627// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
1628// first k fields of t1 equals the first k fields of t2.
1629// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
1630// k1 != k2.
1631template <int kSize1, int kSize2>
1632struct SameSizeTuplePrefixComparator;
1633
1634template <>
1635struct SameSizeTuplePrefixComparator<0, 0> {
1636 template <class Tuple1, class Tuple2>
1637 static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
1638 return true;
1639 }
1640};
1641
1642template <int k>
1643struct SameSizeTuplePrefixComparator<k, k> {
1644 template <class Tuple1, class Tuple2>
1645 static bool Eq(const Tuple1& t1, const Tuple2& t2) {
1646 return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
1647 ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
1648 }
1649};
1650
1651} // namespace gtest_internal
1652
1653template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1654inline bool operator==(const GTEST_10_TUPLE_(T)& t,
1655 const GTEST_10_TUPLE_(U)& u) {
1656 return gtest_internal::SameSizeTuplePrefixComparator<
1657 tuple_size<GTEST_10_TUPLE_(T)>::value,
1658 tuple_size<GTEST_10_TUPLE_(U)>::value>::Eq(t, u);
1659}
1660
1661template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1662inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
1663 const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
1664
1665// 6.1.4 Pairs.
1666// Unimplemented.
1667
1668} // namespace tr1
1669} // namespace std
1670
1671#undef GTEST_0_TUPLE_
1672#undef GTEST_1_TUPLE_
1673#undef GTEST_2_TUPLE_
1674#undef GTEST_3_TUPLE_
1675#undef GTEST_4_TUPLE_
1676#undef GTEST_5_TUPLE_
1677#undef GTEST_6_TUPLE_
1678#undef GTEST_7_TUPLE_
1679#undef GTEST_8_TUPLE_
1680#undef GTEST_9_TUPLE_
1681#undef GTEST_10_TUPLE_
1682
1683#undef GTEST_0_TYPENAMES_
1684#undef GTEST_1_TYPENAMES_
1685#undef GTEST_2_TYPENAMES_
1686#undef GTEST_3_TYPENAMES_
1687#undef GTEST_4_TYPENAMES_
1688#undef GTEST_5_TYPENAMES_
1689#undef GTEST_6_TYPENAMES_
1690#undef GTEST_7_TYPENAMES_
1691#undef GTEST_8_TYPENAMES_
1692#undef GTEST_9_TYPENAMES_
1693#undef GTEST_10_TYPENAMES_
1694
1695#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
1696#undef GTEST_BY_REF_
1697#undef GTEST_ADD_REF_
1698#undef GTEST_TUPLE_ELEMENT_
1699
1700#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1701# elif GTEST_ENV_HAS_STD_TUPLE_
1702# include <tuple>
1703// C++11 puts its tuple into the ::std namespace rather than
1704// ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there.
1705// This causes undefined behavior, but supported compilers react in
1706// the way we intend.
1707namespace std {
1708namespace tr1 {
1709using ::std::get;
1710using ::std::make_tuple;
1711using ::std::tuple;
1712using ::std::tuple_element;
1713using ::std::tuple_size;
1714}
1715}
1716
1717# elif GTEST_OS_SYMBIAN
1718
1719// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
1720// use STLport's tuple implementation, which unfortunately doesn't
1721// work as the copy of STLport distributed with Symbian is incomplete.
1722// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
1723// use its own tuple implementation.
1724# ifdef BOOST_HAS_TR1_TUPLE
1725# undef BOOST_HAS_TR1_TUPLE
1726# endif // BOOST_HAS_TR1_TUPLE
1727
1728// This prevents <boost/tr1/detail/config.hpp>, which defines
1729// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
1730# define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
1731# include <tuple>
1732
1733# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
1734// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
1735// not conform to the TR1 spec, which requires the header to be <tuple>.
1736
1737# if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1738// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
1739// which is #included by <tr1/tuple>, to not compile when RTTI is
1740// disabled. _TR1_FUNCTIONAL is the header guard for
1741// <tr1/functional>. Hence the following #define is a hack to prevent
1742// <tr1/functional> from being included.
1743# define _TR1_FUNCTIONAL 1
1744# include <tr1/tuple>
1745# undef _TR1_FUNCTIONAL // Allows the user to #include
1746 // <tr1/functional> if he chooses to.
1747# else
1748# include <tr1/tuple> // NOLINT
1749# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1750
1751# else
1752// If the compiler is not GCC 4.0+, we assume the user is using a
1753// spec-conforming TR1 implementation.
1754# include <tuple> // NOLINT
1755# endif // GTEST_USE_OWN_TR1_TUPLE
1756
1757#endif // GTEST_HAS_TR1_TUPLE
1758
1759// Determines whether clone(2) is supported.
1760// Usually it will only be available on Linux, excluding
1761// Linux on the Itanium architecture.
1762// Also see http://linux.die.net/man/2/clone.
1763#ifndef GTEST_HAS_CLONE
1764// The user didn't tell us, so we need to figure it out.
1765
1766# if GTEST_OS_LINUX && !defined(__ia64__)
1767# if GTEST_OS_LINUX_ANDROID
1768// On Android, clone() is only available on ARM starting with Gingerbread.
1769# if (defined(__arm__) || defined(__mips__)) && __ANDROID_API__ >= 9
1770# define GTEST_HAS_CLONE 1
1771# else
1772# define GTEST_HAS_CLONE 0
1773# endif
1774# else
1775# define GTEST_HAS_CLONE 1
1776# endif
1777# else
1778# define GTEST_HAS_CLONE 0
1779# endif // GTEST_OS_LINUX && !defined(__ia64__)
1780
1781#endif // GTEST_HAS_CLONE
1782
1783// Determines whether to support stream redirection. This is used to test
1784// output correctness and to implement death tests.
1785#ifndef GTEST_HAS_STREAM_REDIRECTION
1786// By default, we assume that stream redirection is supported on all
1787// platforms except known mobile ones.
1788# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
1789# define GTEST_HAS_STREAM_REDIRECTION 0
1790# else
1791# define GTEST_HAS_STREAM_REDIRECTION 1
1792# endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
1793#endif // GTEST_HAS_STREAM_REDIRECTION
1794
1795// Determines whether to support death tests.
1796// Google Test does not support death tests for VC 7.1 and earlier as
1797// abort() in a VC 7.1 application compiled as GUI in debug config
1798// pops up a dialog window that cannot be suppressed programmatically.
1799#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
1800 (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
1801 (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
1802 GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
1803 GTEST_OS_OPENBSD || GTEST_OS_QNX)
1804# define GTEST_HAS_DEATH_TEST 1
1805# include <vector> // NOLINT
1806#else
1807# define GTEST_HAS_DEATH_TEST 0
1808#endif
1809
1810// We don't support MSVC 7.1 with exceptions disabled now. Therefore
1811// all the compilers we care about are adequate for supporting
1812// value-parameterized tests.
1813#define GTEST_HAS_PARAM_TEST 1
1814
1815// Determines whether to support type-driven tests.
1816
1817// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
1818// Sun Pro CC, IBM Visual Age, and HP aCC support.
1819#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
1820 defined(__IBMCPP__) || defined(__HP_aCC)
1821# define GTEST_HAS_TYPED_TEST 1
1822# define GTEST_HAS_TYPED_TEST_P 1
1823#endif
1824
1825// Determines whether to support Combine(). This only makes sense when
1826// value-parameterized tests are enabled. The implementation doesn't
1827// work on Sun Studio since it doesn't understand templated conversion
1828// operators.
1829#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
1830# define GTEST_HAS_COMBINE 1
1831#endif
1832
1833// Determines whether the system compiler uses UTF-16 for encoding wide strings.
1834#define GTEST_WIDE_STRING_USES_UTF16_ \
1835 (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
1836
1837// Determines whether test results can be streamed to a socket.
1838#if GTEST_OS_LINUX
1839# define GTEST_CAN_STREAM_RESULTS_ 1
1840#else
1841# define GTEST_CAN_STREAM_RESULTS_ 0
1842#endif
1843
1844// Defines some utility macros.
1845
1846// The GNU compiler emits a warning if nested "if" statements are followed by
1847// an "else" statement and braces are not used to explicitly disambiguate the
1848// "else" binding. This leads to problems with code like:
1849//
1850// if (gate)
1851// ASSERT_*(condition) << "Some message";
1852//
1853// The "switch (0) case 0:" idiom is used to suppress this.
1854#ifdef __INTEL_COMPILER
1855# define GTEST_AMBIGUOUS_ELSE_BLOCKER_
1856#else
1857# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
1858#endif
1859
1860// Use this annotation at the end of a struct/class definition to
1861// prevent the compiler from optimizing away instances that are never
1862// used. This is useful when all interesting logic happens inside the
1863// c'tor and / or d'tor. Example:
1864//
1865// struct Foo {
1866// Foo() { ... }
1867// } GTEST_ATTRIBUTE_UNUSED_;
1868//
1869// Also use it after a variable or parameter declaration to tell the
1870// compiler the variable/parameter does not have to be used.
1871#if defined(__GNUC__) && !defined(COMPILER_ICC)
1872# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
1873#else
1874# define GTEST_ATTRIBUTE_UNUSED_
1875#endif
1876
1877// A macro to disallow operator=
1878// This should be used in the private: declarations for a class.
1879#define GTEST_DISALLOW_ASSIGN_(type)\
1880 void operator=(type const &)
1881
1882// A macro to disallow copy constructor and operator=
1883// This should be used in the private: declarations for a class.
1884#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
1885 type(type const &);\
1886 GTEST_DISALLOW_ASSIGN_(type)
1887
1888// Tell the compiler to warn about unused return values for functions declared
1889// with this macro. The macro should be used on function declarations
1890// following the argument list:
1891//
1892// Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
1893#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
1894# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
1895#else
1896# define GTEST_MUST_USE_RESULT_
1897#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
1898
1899// Determine whether the compiler supports Microsoft's Structured Exception
1900// Handling. This is supported by several Windows compilers but generally
1901// does not exist on any other system.
1902#ifndef GTEST_HAS_SEH
1903// The user didn't tell us, so we need to figure it out.
1904
1905# if defined(_MSC_VER) || defined(__BORLANDC__)
1906// These two compilers are known to support SEH.
1907# define GTEST_HAS_SEH 1
1908# else
1909// Assume no SEH.
1910# define GTEST_HAS_SEH 0
1911# endif
1912
1913#endif // GTEST_HAS_SEH
1914
1915#ifdef _MSC_VER
1916
1917# if GTEST_LINKED_AS_SHARED_LIBRARY
1918# define GTEST_API_ __declspec(dllimport)
1919# elif GTEST_CREATE_SHARED_LIBRARY
1920# define GTEST_API_ __declspec(dllexport)
1921# endif
1922
1923#endif // _MSC_VER
1924
1925#ifndef GTEST_API_
1926# define GTEST_API_
1927#endif
1928
1929#ifdef __GNUC__
1930// Ask the compiler to never inline a given function.
1931# define GTEST_NO_INLINE_ __attribute__((noinline))
1932#else
1933# define GTEST_NO_INLINE_
1934#endif
1935
1936// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
1937#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
1938# define GTEST_HAS_CXXABI_H_ 1
1939#else
1940# define GTEST_HAS_CXXABI_H_ 0
1941#endif
1942
1943namespace testing {
1944
1945class Message;
1946
1947namespace internal {
1948
1949// A secret type that Google Test users don't know about. It has no
1950// definition on purpose. Therefore it's impossible to create a
1951// Secret object, which is what we want.
1952class Secret;
1953
1954// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
1955// expression is true. For example, you could use it to verify the
1956// size of a static array:
1957//
1958// GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
1959// content_type_names_incorrect_size);
1960//
1961// or to make sure a struct is smaller than a certain size:
1962//
1963// GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
1964//
1965// The second argument to the macro is the name of the variable. If
1966// the expression is false, most compilers will issue a warning/error
1967// containing the name of the variable.
1968
1969template <bool>
1970struct CompileAssert {
1971};
1972
1973#define GTEST_COMPILE_ASSERT_(expr, msg) \
1974 typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
1975 msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
1976
1977// Implementation details of GTEST_COMPILE_ASSERT_:
1978//
1979// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
1980// elements (and thus is invalid) when the expression is false.
1981//
1982// - The simpler definition
1983//
1984// #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
1985//
1986// does not work, as gcc supports variable-length arrays whose sizes
1987// are determined at run-time (this is gcc's extension and not part
1988// of the C++ standard). As a result, gcc fails to reject the
1989// following code with the simple definition:
1990//
1991// int foo;
1992// GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
1993// // not a compile-time constant.
1994//
1995// - By using the type CompileAssert<(bool(expr))>, we ensures that
1996// expr is a compile-time constant. (Template arguments must be
1997// determined at compile-time.)
1998//
1999// - The outter parentheses in CompileAssert<(bool(expr))> are necessary
2000// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written
2001//
2002// CompileAssert<bool(expr)>
2003//
2004// instead, these compilers will refuse to compile
2005//
2006// GTEST_COMPILE_ASSERT_(5 > 0, some_message);
2007//
2008// (They seem to think the ">" in "5 > 0" marks the end of the
2009// template argument list.)
2010//
2011// - The array size is (bool(expr) ? 1 : -1), instead of simply
2012//
2013// ((expr) ? 1 : -1).
2014//
2015// This is to avoid running into a bug in MS VC 7.1, which
2016// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
2017
2018// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
2019//
2020// This template is declared, but intentionally undefined.
2021template <typename T1, typename T2>
2022struct StaticAssertTypeEqHelper;
2023
2024template <typename T>
2025struct StaticAssertTypeEqHelper<T, T> {};
2026
2027#if GTEST_HAS_GLOBAL_STRING
2028typedef ::string string;
2029#else
2030typedef ::std::string string;
2031#endif // GTEST_HAS_GLOBAL_STRING
2032
2033#if GTEST_HAS_GLOBAL_WSTRING
2034typedef ::wstring wstring;
2035#elif GTEST_HAS_STD_WSTRING
2036typedef ::std::wstring wstring;
2037#endif // GTEST_HAS_GLOBAL_WSTRING
2038
2039// A helper for suppressing warnings on constant condition. It just
2040// returns 'condition'.
2041GTEST_API_ bool IsTrue(bool condition);
2042
2043// Defines scoped_ptr.
2044
2045// This implementation of scoped_ptr is PARTIAL - it only contains
2046// enough stuff to satisfy Google Test's need.
2047template <typename T>
2048class scoped_ptr {
2049 public:
2050 typedef T element_type;
2051
2052 explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
2053 ~scoped_ptr() { reset(); }
2054
2055 T& operator*() const { return *ptr_; }
2056 T* operator->() const { return ptr_; }
2057 T* get() const { return ptr_; }
2058
2059 T* release() {
2060 T* const ptr = ptr_;
2061 ptr_ = NULL;
2062 return ptr;
2063 }
2064
2065 void reset(T* p = NULL) {
2066 if (p != ptr_) {
2067 if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
2068 delete ptr_;
2069 }
2070 ptr_ = p;
2071 }
2072 }
2073
2074 private:
2075 T* ptr_;
2076
2077 GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
2078};
2079
2080// Defines RE.
2081
2082// A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
2083// Regular Expression syntax.
2084class GTEST_API_ RE {
2085 public:
2086 // A copy constructor is required by the Standard to initialize object
2087 // references from r-values.
2088 RE(const RE& other) { Init(other.pattern()); }
2089
2090 // Constructs an RE from a string.
2091 RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
2092
2093#if GTEST_HAS_GLOBAL_STRING
2094
2095 RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
2096
2097#endif // GTEST_HAS_GLOBAL_STRING
2098
2099 RE(const char* regex) { Init(regex); } // NOLINT
2100 ~RE();
2101
2102 // Returns the string representation of the regex.
2103 const char* pattern() const { return pattern_; }
2104
2105 // FullMatch(str, re) returns true iff regular expression re matches
2106 // the entire str.
2107 // PartialMatch(str, re) returns true iff regular expression re
2108 // matches a substring of str (including str itself).
2109 //
2110 // TODO(wan@google.com): make FullMatch() and PartialMatch() work
2111 // when str contains NUL characters.
2112 static bool FullMatch(const ::std::string& str, const RE& re) {
2113 return FullMatch(str.c_str(), re);
2114 }
2115 static bool PartialMatch(const ::std::string& str, const RE& re) {
2116 return PartialMatch(str.c_str(), re);
2117 }
2118
2119#if GTEST_HAS_GLOBAL_STRING
2120
2121 static bool FullMatch(const ::string& str, const RE& re) {
2122 return FullMatch(str.c_str(), re);
2123 }
2124 static bool PartialMatch(const ::string& str, const RE& re) {
2125 return PartialMatch(str.c_str(), re);
2126 }
2127
2128#endif // GTEST_HAS_GLOBAL_STRING
2129
2130 static bool FullMatch(const char* str, const RE& re);
2131 static bool PartialMatch(const char* str, const RE& re);
2132
2133 private:
2134 void Init(const char* regex);
2135
2136 // We use a const char* instead of an std::string, as Google Test used to be
2137 // used where std::string is not available. TODO(wan@google.com): change to
2138 // std::string.
2139 const char* pattern_;
2140 bool is_valid_;
2141
2142#if GTEST_USES_POSIX_RE
2143
2144 regex_t full_regex_; // For FullMatch().
2145 regex_t partial_regex_; // For PartialMatch().
2146
2147#else // GTEST_USES_SIMPLE_RE
2148
2149 const char* full_pattern_; // For FullMatch();
2150
2151#endif
2152
2153 GTEST_DISALLOW_ASSIGN_(RE);
2154};
2155
2156// Formats a source file path and a line number as they would appear
2157// in an error message from the compiler used to compile this code.
2158GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
2159
2160// Formats a file location for compiler-independent XML output.
2161// Although this function is not platform dependent, we put it next to
2162// FormatFileLocation in order to contrast the two functions.
2163GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
2164 int line);
2165
2166// Defines logging utilities:
2167// GTEST_LOG_(severity) - logs messages at the specified severity level. The
2168// message itself is streamed into the macro.
2169// LogToStderr() - directs all log messages to stderr.
2170// FlushInfoLog() - flushes informational log messages.
2171
2172enum GTestLogSeverity {
2173 GTEST_INFO,
2174 GTEST_WARNING,
2175 GTEST_ERROR,
2176 GTEST_FATAL
2177};
2178
2179// Formats log entry severity, provides a stream object for streaming the
2180// log message, and terminates the message with a newline when going out of
2181// scope.
2182class GTEST_API_ GTestLog {
2183 public:
2184 GTestLog(GTestLogSeverity severity, const char* file, int line);
2185
2186 // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
2187 ~GTestLog();
2188
2189 ::std::ostream& GetStream() { return ::std::cerr; }
2190
2191 private:
2192 const GTestLogSeverity severity_;
2193
2194 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
2195};
2196
2197#define GTEST_LOG_(severity) \
2198 ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
2199 __FILE__, __LINE__).GetStream()
2200
2201inline void LogToStderr() {}
2202inline void FlushInfoLog() { fflush(NULL); }
2203
2204// INTERNAL IMPLEMENTATION - DO NOT USE.
2205//
2206// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
2207// is not satisfied.
2208// Synopsys:
2209// GTEST_CHECK_(boolean_condition);
2210// or
2211// GTEST_CHECK_(boolean_condition) << "Additional message";
2212//
2213// This checks the condition and if the condition is not satisfied
2214// it prints message about the condition violation, including the
2215// condition itself, plus additional message streamed into it, if any,
2216// and then it aborts the program. It aborts the program irrespective of
2217// whether it is built in the debug mode or not.
2218#define GTEST_CHECK_(condition) \
2219 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
2220 if (::testing::internal::IsTrue(condition)) \
2221 ; \
2222 else \
2223 GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
2224
2225// An all-mode assert to verify that the given POSIX-style function
2226// call returns 0 (indicating success). Known limitation: this
2227// doesn't expand to a balanced 'if' statement, so enclose the macro
2228// in {} if you need to use it as the only statement in an 'if'
2229// branch.
2230#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
2231 if (const int gtest_error = (posix_call)) \
2232 GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
2233 << gtest_error
2234
2235// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
2236//
2237// Use ImplicitCast_ as a safe version of static_cast for upcasting in
2238// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
2239// const Foo*). When you use ImplicitCast_, the compiler checks that
2240// the cast is safe. Such explicit ImplicitCast_s are necessary in
2241// surprisingly many situations where C++ demands an exact type match
2242// instead of an argument type convertable to a target type.
2243//
2244// The syntax for using ImplicitCast_ is the same as for static_cast:
2245//
2246// ImplicitCast_<ToType>(expr)
2247//
2248// ImplicitCast_ would have been part of the C++ standard library,
2249// but the proposal was submitted too late. It will probably make
2250// its way into the language in the future.
2251//
2252// This relatively ugly name is intentional. It prevents clashes with
2253// similar functions users may have (e.g., implicit_cast). The internal
2254// namespace alone is not enough because the function can be found by ADL.
2255template<typename To>
2256inline To ImplicitCast_(To x) { return x; }
2257
2258// When you upcast (that is, cast a pointer from type Foo to type
2259// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
2260// always succeed. When you downcast (that is, cast a pointer from
2261// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
2262// how do you know the pointer is really of type SubclassOfFoo? It
2263// could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
2264// when you downcast, you should use this macro. In debug mode, we
2265// use dynamic_cast<> to double-check the downcast is legal (we die
2266// if it's not). In normal mode, we do the efficient static_cast<>
2267// instead. Thus, it's important to test in debug mode to make sure
2268// the cast is legal!
2269// This is the only place in the code we should use dynamic_cast<>.
2270// In particular, you SHOULDN'T be using dynamic_cast<> in order to
2271// do RTTI (eg code like this:
2272// if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
2273// if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
2274// You should design the code some other way not to need this.
2275//
2276// This relatively ugly name is intentional. It prevents clashes with
2277// similar functions users may have (e.g., down_cast). The internal
2278// namespace alone is not enough because the function can be found by ADL.
2279template<typename To, typename From> // use like this: DownCast_<T*>(foo);
2280inline To DownCast_(From* f) { // so we only accept pointers
2281 // Ensures that To is a sub-type of From *. This test is here only
2282 // for compile-time type checking, and has no overhead in an
2283 // optimized build at run-time, as it will be optimized away
2284 // completely.
2285 if (false) {
2286 const To to = NULL;
2287 ::testing::internal::ImplicitCast_<From*>(to);
2288 }
2289
2290#if GTEST_HAS_RTTI
2291 // RTTI: debug mode only!
2292 GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
2293#endif
2294 return static_cast<To>(f);
2295}
2296
2297// Downcasts the pointer of type Base to Derived.
2298// Derived must be a subclass of Base. The parameter MUST
2299// point to a class of type Derived, not any subclass of it.
2300// When RTTI is available, the function performs a runtime
2301// check to enforce this.
2302template <class Derived, class Base>
2303Derived* CheckedDowncastToActualType(Base* base) {
2304#if GTEST_HAS_RTTI
2305 GTEST_CHECK_(typeid(*base) == typeid(Derived));
2306 return dynamic_cast<Derived*>(base); // NOLINT
2307#else
2308 return static_cast<Derived*>(base); // Poor man's downcast.
2309#endif
2310}
2311
2312#if GTEST_HAS_STREAM_REDIRECTION
2313
2314// Defines the stderr capturer:
2315// CaptureStdout - starts capturing stdout.
2316// GetCapturedStdout - stops capturing stdout and returns the captured string.
2317// CaptureStderr - starts capturing stderr.
2318// GetCapturedStderr - stops capturing stderr and returns the captured string.
2319//
2320GTEST_API_ void CaptureStdout();
2321GTEST_API_ std::string GetCapturedStdout();
2322GTEST_API_ void CaptureStderr();
2323GTEST_API_ std::string GetCapturedStderr();
2324
2325#endif // GTEST_HAS_STREAM_REDIRECTION
2326
2327
2328#if GTEST_HAS_DEATH_TEST
2329
2330const ::std::vector<testing::internal::string>& GetInjectableArgvs();
2331void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
2332 new_argvs);
2333
2334// A copy of all command line arguments. Set by InitGoogleTest().
2335extern ::std::vector<testing::internal::string> g_argvs;
2336
2337#endif // GTEST_HAS_DEATH_TEST
2338
2339// Defines synchronization primitives.
2340
2341#if GTEST_HAS_PTHREAD
2342
2343// Sleeps for (roughly) n milli-seconds. This function is only for
2344// testing Google Test's own constructs. Don't use it in user tests,
2345// either directly or indirectly.
2346inline void SleepMilliseconds(int n) {
2347 const timespec time = {
2348 0, // 0 seconds.
2349 n * 1000L * 1000L, // And n ms.
2350 };
2351 nanosleep(&time, NULL);
2352}
2353
2354// Allows a controller thread to pause execution of newly created
2355// threads until notified. Instances of this class must be created
2356// and destroyed in the controller thread.
2357//
2358// This class is only for testing Google Test's own constructs. Do not
2359// use it in user tests, either directly or indirectly.
2360class Notification {
2361 public:
2362 Notification() : notified_(false) {
2363 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2364 }
2365 ~Notification() {
2366 pthread_mutex_destroy(&mutex_);
2367 }
2368
2369 // Notifies all threads created with this notification to start. Must
2370 // be called from the controller thread.
2371 void Notify() {
2372 pthread_mutex_lock(&mutex_);
2373 notified_ = true;
2374 pthread_mutex_unlock(&mutex_);
2375 }
2376
2377 // Blocks until the controller thread notifies. Must be called from a test
2378 // thread.
2379 void WaitForNotification() {
2380 for (;;) {
2381 pthread_mutex_lock(&mutex_);
2382 const bool notified = notified_;
2383 pthread_mutex_unlock(&mutex_);
2384 if (notified)
2385 break;
2386 SleepMilliseconds(10);
2387 }
2388 }
2389
2390 private:
2391 pthread_mutex_t mutex_;
2392 bool notified_;
2393
2394 GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2395};
2396
2397// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
2398// Consequently, it cannot select a correct instantiation of ThreadWithParam
2399// in order to call its Run(). Introducing ThreadWithParamBase as a
2400// non-templated base class for ThreadWithParam allows us to bypass this
2401// problem.
2402class ThreadWithParamBase {
2403 public:
2404 virtual ~ThreadWithParamBase() {}
2405 virtual void Run() = 0;
2406};
2407
2408// pthread_create() accepts a pointer to a function type with the C linkage.
2409// According to the Standard (7.5/1), function types with different linkages
2410// are different even if they are otherwise identical. Some compilers (for
2411// example, SunStudio) treat them as different types. Since class methods
2412// cannot be defined with C-linkage we need to define a free C-function to
2413// pass into pthread_create().
2414extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
2415 static_cast<ThreadWithParamBase*>(thread)->Run();
2416 return NULL;
2417}
2418
2419// Helper class for testing Google Test's multi-threading constructs.
2420// To use it, write:
2421//
2422// void ThreadFunc(int param) { /* Do things with param */ }
2423// Notification thread_can_start;
2424// ...
2425// // The thread_can_start parameter is optional; you can supply NULL.
2426// ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
2427// thread_can_start.Notify();
2428//
2429// These classes are only for testing Google Test's own constructs. Do
2430// not use them in user tests, either directly or indirectly.
2431template <typename T>
2432class ThreadWithParam : public ThreadWithParamBase {
2433 public:
2434 typedef void (*UserThreadFunc)(T);
2435
2436 ThreadWithParam(
2437 UserThreadFunc func, T param, Notification* thread_can_start)
2438 : func_(func),
2439 param_(param),
2440 thread_can_start_(thread_can_start),
2441 finished_(false) {
2442 ThreadWithParamBase* const base = this;
2443 // The thread can be created only after all fields except thread_
2444 // have been initialized.
2445 GTEST_CHECK_POSIX_SUCCESS_(
2446 pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
2447 }
2448 ~ThreadWithParam() { Join(); }
2449
2450 void Join() {
2451 if (!finished_) {
2452 GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
2453 finished_ = true;
2454 }
2455 }
2456
2457 virtual void Run() {
2458 if (thread_can_start_ != NULL)
2459 thread_can_start_->WaitForNotification();
2460 func_(param_);
2461 }
2462
2463 private:
2464 const UserThreadFunc func_; // User-supplied thread function.
2465 const T param_; // User-supplied parameter to the thread function.
2466 // When non-NULL, used to block execution until the controller thread
2467 // notifies.
2468 Notification* const thread_can_start_;
2469 bool finished_; // true iff we know that the thread function has finished.
2470 pthread_t thread_; // The native thread object.
2471
2472 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
2473};
2474
2475// MutexBase and Mutex implement mutex on pthreads-based platforms. They
2476// are used in conjunction with class MutexLock:
2477//
2478// Mutex mutex;
2479// ...
2480// MutexLock lock(&mutex); // Acquires the mutex and releases it at the end
2481// // of the current scope.
2482//
2483// MutexBase implements behavior for both statically and dynamically
2484// allocated mutexes. Do not use MutexBase directly. Instead, write
2485// the following to define a static mutex:
2486//
2487// GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
2488//
2489// You can forward declare a static mutex like this:
2490//
2491// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
2492//
2493// To create a dynamic mutex, just define an object of type Mutex.
2494class MutexBase {
2495 public:
2496 // Acquires this mutex.
2497 void Lock() {
2498 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
2499 owner_ = pthread_self();
2500 has_owner_ = true;
2501 }
2502
2503 // Releases this mutex.
2504 void Unlock() {
2505 // Since the lock is being released the owner_ field should no longer be
2506 // considered valid. We don't protect writing to has_owner_ here, as it's
2507 // the caller's responsibility to ensure that the current thread holds the
2508 // mutex when this is called.
2509 has_owner_ = false;
2510 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
2511 }
2512
2513 // Does nothing if the current thread holds the mutex. Otherwise, crashes
2514 // with high probability.
2515 void AssertHeld() const {
2516 GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
2517 << "The current thread is not holding the mutex @" << this;
2518 }
2519
2520 // A static mutex may be used before main() is entered. It may even
2521 // be used before the dynamic initialization stage. Therefore we
2522 // must be able to initialize a static mutex object at link time.
2523 // This means MutexBase has to be a POD and its member variables
2524 // have to be public.
2525 public:
2526 pthread_mutex_t mutex_; // The underlying pthread mutex.
2527 // has_owner_ indicates whether the owner_ field below contains a valid thread
2528 // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
2529 // accesses to the owner_ field should be protected by a check of this field.
2530 // An alternative might be to memset() owner_ to all zeros, but there's no
2531 // guarantee that a zero'd pthread_t is necessarily invalid or even different
2532 // from pthread_self().
2533 bool has_owner_;
2534 pthread_t owner_; // The thread holding the mutex.
2535};
2536
2537// Forward-declares a static mutex.
2538# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2539 extern ::testing::internal::MutexBase mutex
2540
2541// Defines and statically (i.e. at link time) initializes a static mutex.
2542// The initialization list here does not explicitly initialize each field,
2543// instead relying on default initialization for the unspecified fields. In
2544// particular, the owner_ field (a pthread_t) is not explicitly initialized.
2545// This allows initialization to work whether pthread_t is a scalar or struct.
2546// The flag -Wmissing-field-initializers must not be specified for this to work.
2547# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
2548 ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
2549
2550// The Mutex class can only be used for mutexes created at runtime. It
2551// shares its API with MutexBase otherwise.
2552class Mutex : public MutexBase {
2553 public:
2554 Mutex() {
2555 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2556 has_owner_ = false;
2557 }
2558 ~Mutex() {
2559 GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
2560 }
2561
2562 private:
2563 GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
2564};
2565
2566// We cannot name this class MutexLock as the ctor declaration would
2567// conflict with a macro named MutexLock, which is defined on some
2568// platforms. Hence the typedef trick below.
2569class GTestMutexLock {
2570 public:
2571 explicit GTestMutexLock(MutexBase* mutex)
2572 : mutex_(mutex) { mutex_->Lock(); }
2573
2574 ~GTestMutexLock() { mutex_->Unlock(); }
2575
2576 private:
2577 MutexBase* const mutex_;
2578
2579 GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
2580};
2581
2582typedef GTestMutexLock MutexLock;
2583
2584// Helpers for ThreadLocal.
2585
2586// pthread_key_create() requires DeleteThreadLocalValue() to have
2587// C-linkage. Therefore it cannot be templatized to access
2588// ThreadLocal<T>. Hence the need for class
2589// ThreadLocalValueHolderBase.
2590class ThreadLocalValueHolderBase {
2591 public:
2592 virtual ~ThreadLocalValueHolderBase() {}
2593};
2594
2595// Called by pthread to delete thread-local data stored by
2596// pthread_setspecific().
2597extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
2598 delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
2599}
2600
2601// Implements thread-local storage on pthreads-based systems.
2602//
2603// // Thread 1
2604// ThreadLocal<int> tl(100); // 100 is the default value for each thread.
2605//
2606// // Thread 2
2607// tl.set(150); // Changes the value for thread 2 only.
2608// EXPECT_EQ(150, tl.get());
2609//
2610// // Thread 1
2611// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
2612// tl.set(200);
2613// EXPECT_EQ(200, tl.get());
2614//
2615// The template type argument T must have a public copy constructor.
2616// In addition, the default ThreadLocal constructor requires T to have
2617// a public default constructor.
2618//
2619// An object managed for a thread by a ThreadLocal instance is deleted
2620// when the thread exits. Or, if the ThreadLocal instance dies in
2621// that thread, when the ThreadLocal dies. It's the user's
2622// responsibility to ensure that all other threads using a ThreadLocal
2623// have exited when it dies, or the per-thread objects for those
2624// threads will not be deleted.
2625//
2626// Google Test only uses global ThreadLocal objects. That means they
2627// will die after main() has returned. Therefore, no per-thread
2628// object managed by Google Test will be leaked as long as all threads
2629// using Google Test have exited when main() returns.
2630template <typename T>
2631class ThreadLocal {
2632 public:
2633 ThreadLocal() : key_(CreateKey()),
2634 default_() {}
2635 explicit ThreadLocal(const T& value) : key_(CreateKey()),
2636 default_(value) {}
2637
2638 ~ThreadLocal() {
2639 // Destroys the managed object for the current thread, if any.
2640 DeleteThreadLocalValue(pthread_getspecific(key_));
2641
2642 // Releases resources associated with the key. This will *not*
2643 // delete managed objects for other threads.
2644 GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
2645 }
2646
2647 T* pointer() { return GetOrCreateValue(); }
2648 const T* pointer() const { return GetOrCreateValue(); }
2649 const T& get() const { return *pointer(); }
2650 void set(const T& value) { *pointer() = value; }
2651
2652 private:
2653 // Holds a value of type T.
2654 class ValueHolder : public ThreadLocalValueHolderBase {
2655 public:
2656 explicit ValueHolder(const T& value) : value_(value) {}
2657
2658 T* pointer() { return &value_; }
2659
2660 private:
2661 T value_;
2662 GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
2663 };
2664
2665 static pthread_key_t CreateKey() {
2666 pthread_key_t key;
2667 // When a thread exits, DeleteThreadLocalValue() will be called on
2668 // the object managed for that thread.
2669 GTEST_CHECK_POSIX_SUCCESS_(
2670 pthread_key_create(&key, &DeleteThreadLocalValue));
2671 return key;
2672 }
2673
2674 T* GetOrCreateValue() const {
2675 ThreadLocalValueHolderBase* const holder =
2676 static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
2677 if (holder != NULL) {
2678 return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
2679 }
2680
2681 ValueHolder* const new_holder = new ValueHolder(default_);
2682 ThreadLocalValueHolderBase* const holder_base = new_holder;
2683 GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
2684 return new_holder->pointer();
2685 }
2686
2687 // A key pthreads uses for looking up per-thread values.
2688 const pthread_key_t key_;
2689 const T default_; // The default value for each thread.
2690
2691 GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
2692};
2693
2694# define GTEST_IS_THREADSAFE 1
2695
2696#else // GTEST_HAS_PTHREAD
2697
2698// A dummy implementation of synchronization primitives (mutex, lock,
2699// and thread-local variable). Necessary for compiling Google Test where
2700// mutex is not supported - using Google Test in multiple threads is not
2701// supported on such platforms.
2702
2703class Mutex {
2704 public:
2705 Mutex() {}
2706 void Lock() {}
2707 void Unlock() {}
2708 void AssertHeld() const {}
2709};
2710
2711# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2712 extern ::testing::internal::Mutex mutex
2713
2714# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
2715
2716class GTestMutexLock {
2717 public:
2718 explicit GTestMutexLock(Mutex*) {} // NOLINT
2719};
2720
2721typedef GTestMutexLock MutexLock;
2722
2723template <typename T>
2724class ThreadLocal {
2725 public:
2726 ThreadLocal() : value_() {}
2727 explicit ThreadLocal(const T& value) : value_(value) {}
2728 T* pointer() { return &value_; }
2729 const T* pointer() const { return &value_; }
2730 const T& get() const { return value_; }
2731 void set(const T& value) { value_ = value; }
2732 private:
2733 T value_;
2734};
2735
2736// The above synchronization primitives have dummy implementations.
2737// Therefore Google Test is not thread-safe.
2738# define GTEST_IS_THREADSAFE 0
2739
2740#endif // GTEST_HAS_PTHREAD
2741
2742// Returns the number of threads running in the process, or 0 to indicate that
2743// we cannot detect it.
2744GTEST_API_ size_t GetThreadCount();
2745
2746// Passing non-POD classes through ellipsis (...) crashes the ARM
2747// compiler and generates a warning in Sun Studio. The Nokia Symbian
2748// and the IBM XL C/C++ compiler try to instantiate a copy constructor
2749// for objects passed through ellipsis (...), failing for uncopyable
2750// objects. We define this to ensure that only POD is passed through
2751// ellipsis on these systems.
2752#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
2753// We lose support for NULL detection where the compiler doesn't like
2754// passing non-POD classes through ellipsis (...).
2755# define GTEST_ELLIPSIS_NEEDS_POD_ 1
2756#else
2757# define GTEST_CAN_COMPARE_NULL 1
2758#endif
2759
2760// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
2761// const T& and const T* in a function template. These compilers
2762// _can_ decide between class template specializations for T and T*,
2763// so a tr1::type_traits-like is_pointer works.
2764#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
2765# define GTEST_NEEDS_IS_POINTER_ 1
2766#endif
2767
2768template <bool bool_value>
2769struct bool_constant {
2770 typedef bool_constant<bool_value> type;
2771 static const bool value = bool_value;
2772};
2773template <bool bool_value> const bool bool_constant<bool_value>::value;
2774
2775typedef bool_constant<false> false_type;
2776typedef bool_constant<true> true_type;
2777
2778template <typename T>
2779struct is_pointer : public false_type {};
2780
2781template <typename T>
2782struct is_pointer<T*> : public true_type {};
2783
2784template <typename Iterator>
2785struct IteratorTraits {
2786 typedef typename Iterator::value_type value_type;
2787};
2788
2789template <typename T>
2790struct IteratorTraits<T*> {
2791 typedef T value_type;
2792};
2793
2794template <typename T>
2795struct IteratorTraits<const T*> {
2796 typedef T value_type;
2797};
2798
2799#if GTEST_OS_WINDOWS
2800# define GTEST_PATH_SEP_ "\\"
2801# define GTEST_HAS_ALT_PATH_SEP_ 1
2802// The biggest signed integer type the compiler supports.
2803typedef __int64 BiggestInt;
2804#else
2805# define GTEST_PATH_SEP_ "/"
2806# define GTEST_HAS_ALT_PATH_SEP_ 0
2807typedef long long BiggestInt; // NOLINT
2808#endif // GTEST_OS_WINDOWS
2809
2810// Utilities for char.
2811
2812// isspace(int ch) and friends accept an unsigned char or EOF. char
2813// may be signed, depending on the compiler (or compiler flags).
2814// Therefore we need to cast a char to unsigned char before calling
2815// isspace(), etc.
2816
2817inline bool IsAlpha(char ch) {
2818 return isalpha(static_cast<unsigned char>(ch)) != 0;
2819}
2820inline bool IsAlNum(char ch) {
2821 return isalnum(static_cast<unsigned char>(ch)) != 0;
2822}
2823inline bool IsDigit(char ch) {
2824 return isdigit(static_cast<unsigned char>(ch)) != 0;
2825}
2826inline bool IsLower(char ch) {
2827 return islower(static_cast<unsigned char>(ch)) != 0;
2828}
2829inline bool IsSpace(char ch) {
2830 return isspace(static_cast<unsigned char>(ch)) != 0;
2831}
2832inline bool IsUpper(char ch) {
2833 return isupper(static_cast<unsigned char>(ch)) != 0;
2834}
2835inline bool IsXDigit(char ch) {
2836 return isxdigit(static_cast<unsigned char>(ch)) != 0;
2837}
2838inline bool IsXDigit(wchar_t ch) {
2839 const unsigned char low_byte = static_cast<unsigned char>(ch);
2840 return ch == low_byte && isxdigit(low_byte) != 0;
2841}
2842
2843inline char ToLower(char ch) {
2844 return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
2845}
2846inline char ToUpper(char ch) {
2847 return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
2848}
2849
2850// The testing::internal::posix namespace holds wrappers for common
2851// POSIX functions. These wrappers hide the differences between
2852// Windows/MSVC and POSIX systems. Since some compilers define these
2853// standard functions as macros, the wrapper cannot have the same name
2854// as the wrapped function.
2855
2856namespace posix {
2857
2858// Functions with a different name on Windows.
2859
2860#if GTEST_OS_WINDOWS
2861
2862typedef struct _stat StatStruct;
2863
2864# ifdef __BORLANDC__
2865inline int IsATTY(int fd) { return isatty(fd); }
2866inline int StrCaseCmp(const char* s1, const char* s2) {
2867 return stricmp(s1, s2);
2868}
2869inline char* StrDup(const char* src) { return strdup(src); }
2870# else // !__BORLANDC__
2871# if GTEST_OS_WINDOWS_MOBILE
2872inline int IsATTY(int /* fd */) { return 0; }
2873# else
2874inline int IsATTY(int fd) { return _isatty(fd); }
2875# endif // GTEST_OS_WINDOWS_MOBILE
2876inline int StrCaseCmp(const char* s1, const char* s2) {
2877 return _stricmp(s1, s2);
2878}
2879inline char* StrDup(const char* src) { return _strdup(src); }
2880# endif // __BORLANDC__
2881
2882# if GTEST_OS_WINDOWS_MOBILE
2883inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
2884// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
2885// time and thus not defined there.
2886# else
2887inline int FileNo(FILE* file) { return _fileno(file); }
2888inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
2889inline int RmDir(const char* dir) { return _rmdir(dir); }
2890inline bool IsDir(const StatStruct& st) {
2891 return (_S_IFDIR & st.st_mode) != 0;
2892}
2893# endif // GTEST_OS_WINDOWS_MOBILE
2894
2895#else
2896
2897typedef struct stat StatStruct;
2898
2899inline int FileNo(FILE* file) { return fileno(file); }
2900inline int IsATTY(int fd) { return isatty(fd); }
2901inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
2902inline int StrCaseCmp(const char* s1, const char* s2) {
2903 return strcasecmp(s1, s2);
2904}
2905inline char* StrDup(const char* src) { return strdup(src); }
2906inline int RmDir(const char* dir) { return rmdir(dir); }
2907inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
2908
2909#endif // GTEST_OS_WINDOWS
2910
2911// Functions deprecated by MSVC 8.0.
2912
2913#ifdef _MSC_VER
2914// Temporarily disable warning 4996 (deprecated function).
2915# pragma warning(push)
2916# pragma warning(disable:4996)
2917#endif
2918
2919inline const char* StrNCpy(char* dest, const char* src, size_t n) {
2920 return strncpy(dest, src, n);
2921}
2922
2923// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
2924// StrError() aren't needed on Windows CE at this time and thus not
2925// defined there.
2926
2927#if !GTEST_OS_WINDOWS_MOBILE
2928inline int ChDir(const char* dir) { return chdir(dir); }
2929#endif
2930inline FILE* FOpen(const char* path, const char* mode) {
2931 return fopen(path, mode);
2932}
2933#if !GTEST_OS_WINDOWS_MOBILE
2934inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
2935 return freopen(path, mode, stream);
2936}
2937inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
2938#endif
2939inline int FClose(FILE* fp) { return fclose(fp); }
2940#if !GTEST_OS_WINDOWS_MOBILE
2941inline int Read(int fd, void* buf, unsigned int count) {
2942 return static_cast<int>(read(fd, buf, count));
2943}
2944inline int Write(int fd, const void* buf, unsigned int count) {
2945 return static_cast<int>(write(fd, buf, count));
2946}
2947inline int Close(int fd) { return close(fd); }
2948inline const char* StrError(int errnum) { return strerror(errnum); }
2949#endif
2950inline const char* GetEnv(const char* name) {
2951#if GTEST_OS_WINDOWS_MOBILE
2952 // We are on Windows CE, which has no environment variables.
2953 return NULL;
2954#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
2955 // Environment variables which we programmatically clear will be set to the
2956 // empty string rather than unset (NULL). Handle that case.
2957 const char* const env = getenv(name);
2958 return (env != NULL && env[0] != '\0') ? env : NULL;
2959#else
2960 return getenv(name);
2961#endif
2962}
2963
2964#ifdef _MSC_VER
2965# pragma warning(pop) // Restores the warning state.
2966#endif
2967
2968#if GTEST_OS_WINDOWS_MOBILE
2969// Windows CE has no C library. The abort() function is used in
2970// several places in Google Test. This implementation provides a reasonable
2971// imitation of standard behaviour.
2972void Abort();
2973#else
2974inline void Abort() { abort(); }
2975#endif // GTEST_OS_WINDOWS_MOBILE
2976
2977} // namespace posix
2978
2979// MSVC "deprecates" snprintf and issues warnings wherever it is used. In
2980// order to avoid these warnings, we need to use _snprintf or _snprintf_s on
2981// MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
2982// function in order to achieve that. We use macro definition here because
2983// snprintf is a variadic function.
2984#if defined(_MSC_VER) && _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
2985// MSVC 2005 and above support variadic macros.
2986# define GTEST_SNPRINTF_(buffer, size, format, ...) \
2987 _snprintf_s(buffer, size, size, format, __VA_ARGS__)
2988#elif defined(_MSC_VER)
2989// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
2990// complain about _snprintf.
2991# define GTEST_SNPRINTF_ _snprintf
2992#else
2993# define GTEST_SNPRINTF_ snprintf
2994#endif
2995
2996// The maximum number a BiggestInt can represent. This definition
2997// works no matter BiggestInt is represented in one's complement or
2998// two's complement.
2999//
3000// We cannot rely on numeric_limits in STL, as __int64 and long long
3001// are not part of standard C++ and numeric_limits doesn't need to be
3002// defined for them.
3003const BiggestInt kMaxBiggestInt =
3004 ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
3005
3006// This template class serves as a compile-time function from size to
3007// type. It maps a size in bytes to a primitive type with that
3008// size. e.g.
3009//
3010// TypeWithSize<4>::UInt
3011//
3012// is typedef-ed to be unsigned int (unsigned integer made up of 4
3013// bytes).
3014//
3015// Such functionality should belong to STL, but I cannot find it
3016// there.
3017//
3018// Google Test uses this class in the implementation of floating-point
3019// comparison.
3020//
3021// For now it only handles UInt (unsigned int) as that's all Google Test
3022// needs. Other types can be easily added in the future if need
3023// arises.
3024template <size_t size>
3025class TypeWithSize {
3026 public:
3027 // This prevents the user from using TypeWithSize<N> with incorrect
3028 // values of N.
3029 typedef void UInt;
3030};
3031
3032// The specialization for size 4.
3033template <>
3034class TypeWithSize<4> {
3035 public:
3036 // unsigned int has size 4 in both gcc and MSVC.
3037 //
3038 // As base/basictypes.h doesn't compile on Windows, we cannot use
3039 // uint32, uint64, and etc here.
3040 typedef int Int;
3041 typedef unsigned int UInt;
3042};
3043
3044// The specialization for size 8.
3045template <>
3046class TypeWithSize<8> {
3047 public:
3048#if GTEST_OS_WINDOWS
3049 typedef __int64 Int;
3050 typedef unsigned __int64 UInt;
3051#else
3052 typedef long long Int; // NOLINT
3053 typedef unsigned long long UInt; // NOLINT
3054#endif // GTEST_OS_WINDOWS
3055};
3056
3057// Integer types of known sizes.
3058typedef TypeWithSize<4>::Int Int32;
3059typedef TypeWithSize<4>::UInt UInt32;
3060typedef TypeWithSize<8>::Int Int64;
3061typedef TypeWithSize<8>::UInt UInt64;
3062typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
3063
3064// Utilities for command line flags and environment variables.
3065
3066// Macro for referencing flags.
3067#define GTEST_FLAG(name) FLAGS_gtest_##name
3068
3069// Macros for declaring flags.
3070#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
3071#define GTEST_DECLARE_int32_(name) \
3072 GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
3073#define GTEST_DECLARE_string_(name) \
3074 GTEST_API_ extern ::std::string GTEST_FLAG(name)
3075
3076// Macros for defining flags.
3077#define GTEST_DEFINE_bool_(name, default_val, doc) \
3078 GTEST_API_ bool GTEST_FLAG(name) = (default_val)
3079#define GTEST_DEFINE_int32_(name, default_val, doc) \
3080 GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
3081#define GTEST_DEFINE_string_(name, default_val, doc) \
3082 GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
3083
3084// Thread annotations
3085#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
3086#define GTEST_LOCK_EXCLUDED_(locks)
3087
3088// Parses 'str' for a 32-bit signed integer. If successful, writes the result
3089// to *value and returns true; otherwise leaves *value unchanged and returns
3090// false.
3091// TODO(chandlerc): Find a better way to refactor flag and environment parsing
3092// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
3093// function.
3094bool ParseInt32(const Message& src_text, const char* str, Int32* value);
3095
3096// Parses a bool/Int32/string from the environment variable
3097// corresponding to the given Google Test flag.
3098bool BoolFromGTestEnv(const char* flag, bool default_val);
3099GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
3100const char* StringFromGTestEnv(const char* flag, const char* default_val);
3101
3102} // namespace internal
3103} // namespace testing
3104
3105#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
3106
3107#if GTEST_OS_LINUX
3108# include <stdlib.h>
3109# include <sys/types.h>
3110# include <sys/wait.h>
3111# include <unistd.h>
3112#endif // GTEST_OS_LINUX
3113
3114#if GTEST_HAS_EXCEPTIONS
3115# include <stdexcept>
3116#endif
3117
3118#include <ctype.h>
3119#include <float.h>
3120#include <string.h>
3121#include <iomanip>
3122#include <limits>
3123#include <set>
3124
3125// Copyright 2005, Google Inc.
3126// All rights reserved.
3127//
3128// Redistribution and use in source and binary forms, with or without
3129// modification, are permitted provided that the following conditions are
3130// met:
3131//
3132// * Redistributions of source code must retain the above copyright
3133// notice, this list of conditions and the following disclaimer.
3134// * Redistributions in binary form must reproduce the above
3135// copyright notice, this list of conditions and the following disclaimer
3136// in the documentation and/or other materials provided with the
3137// distribution.
3138// * Neither the name of Google Inc. nor the names of its
3139// contributors may be used to endorse or promote products derived from
3140// this software without specific prior written permission.
3141//
3142// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3143// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3144// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3145// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3146// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3147// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3148// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3149// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3150// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3151// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3152// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3153//
3154// Author: wan@google.com (Zhanyong Wan)
3155//
3156// The Google C++ Testing Framework (Google Test)
3157//
3158// This header file defines the Message class.
3159//
3160// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
3161// leave some internal implementation details in this header file.
3162// They are clearly marked by comments like this:
3163//
3164// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
3165//
3166// Such code is NOT meant to be used by a user directly, and is subject
3167// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
3168// program!
3169
3170#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3171#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3172
3173#include <limits>
3174
3175
3176// Ensures that there is at least one operator<< in the global namespace.
3177// See Message& operator<<(...) below for why.
3178void operator<<(const testing::internal::Secret&, int);
3179
3180namespace testing {
3181
3182// The Message class works like an ostream repeater.
3183//
3184// Typical usage:
3185//
3186// 1. You stream a bunch of values to a Message object.
3187// It will remember the text in a stringstream.
3188// 2. Then you stream the Message object to an ostream.
3189// This causes the text in the Message to be streamed
3190// to the ostream.
3191//
3192// For example;
3193//
3194// testing::Message foo;
3195// foo << 1 << " != " << 2;
3196// std::cout << foo;
3197//
3198// will print "1 != 2".
3199//
3200// Message is not intended to be inherited from. In particular, its
3201// destructor is not virtual.
3202//
3203// Note that stringstream behaves differently in gcc and in MSVC. You
3204// can stream a NULL char pointer to it in the former, but not in the
3205// latter (it causes an access violation if you do). The Message
3206// class hides this difference by treating a NULL char pointer as
3207// "(null)".
3208class GTEST_API_ Message {
3209 private:
3210 // The type of basic IO manipulators (endl, ends, and flush) for
3211 // narrow streams.
3212 typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
3213
3214 public:
3215 // Constructs an empty Message.
3216 Message();
3217
3218 // Copy constructor.
3219 Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
3220 *ss_ << msg.GetString();
3221 }
3222
3223 // Constructs a Message from a C-string.
3224 explicit Message(const char* str) : ss_(new ::std::stringstream) {
3225 *ss_ << str;
3226 }
3227
3228#if GTEST_OS_SYMBIAN
3229 // Streams a value (either a pointer or not) to this object.
3230 template <typename T>
3231 inline Message& operator <<(const T& value) {
3232 StreamHelper(typename internal::is_pointer<T>::type(), value);
3233 return *this;
3234 }
3235#else
3236 // Streams a non-pointer value to this object.
3237 template <typename T>
3238 inline Message& operator <<(const T& val) {
3239 // Some libraries overload << for STL containers. These
3240 // overloads are defined in the global namespace instead of ::std.
3241 //
3242 // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
3243 // overloads are visible in either the std namespace or the global
3244 // namespace, but not other namespaces, including the testing
3245 // namespace which Google Test's Message class is in.
3246 //
3247 // To allow STL containers (and other types that has a << operator
3248 // defined in the global namespace) to be used in Google Test
3249 // assertions, testing::Message must access the custom << operator
3250 // from the global namespace. With this using declaration,
3251 // overloads of << defined in the global namespace and those
3252 // visible via Koenig lookup are both exposed in this function.
3253 using ::operator <<;
3254 *ss_ << val;
3255 return *this;
3256 }
3257
3258 // Streams a pointer value to this object.
3259 //
3260 // This function is an overload of the previous one. When you
3261 // stream a pointer to a Message, this definition will be used as it
3262 // is more specialized. (The C++ Standard, section
3263 // [temp.func.order].) If you stream a non-pointer, then the
3264 // previous definition will be used.
3265 //
3266 // The reason for this overload is that streaming a NULL pointer to
3267 // ostream is undefined behavior. Depending on the compiler, you
3268 // may get "0", "(nil)", "(null)", or an access violation. To
3269 // ensure consistent result across compilers, we always treat NULL
3270 // as "(null)".
3271 template <typename T>
3272 inline Message& operator <<(T* const& pointer) { // NOLINT
3273 if (pointer == NULL) {
3274 *ss_ << "(null)";
3275 } else {
3276 *ss_ << pointer;
3277 }
3278 return *this;
3279 }
3280#endif // GTEST_OS_SYMBIAN
3281
3282 // Since the basic IO manipulators are overloaded for both narrow
3283 // and wide streams, we have to provide this specialized definition
3284 // of operator <<, even though its body is the same as the
3285 // templatized version above. Without this definition, streaming
3286 // endl or other basic IO manipulators to Message will confuse the
3287 // compiler.
3288 Message& operator <<(BasicNarrowIoManip val) {
3289 *ss_ << val;
3290 return *this;
3291 }
3292
3293 // Instead of 1/0, we want to see true/false for bool values.
3294 Message& operator <<(bool b) {
3295 return *this << (b ? "true" : "false");
3296 }
3297
3298 // These two overloads allow streaming a wide C string to a Message
3299 // using the UTF-8 encoding.
3300 Message& operator <<(const wchar_t* wide_c_str);
3301 Message& operator <<(wchar_t* wide_c_str);
3302
3303#if GTEST_HAS_STD_WSTRING
3304 // Converts the given wide string to a narrow string using the UTF-8
3305 // encoding, and streams the result to this Message object.
3306 Message& operator <<(const ::std::wstring& wstr);
3307#endif // GTEST_HAS_STD_WSTRING
3308
3309#if GTEST_HAS_GLOBAL_WSTRING
3310 // Converts the given wide string to a narrow string using the UTF-8
3311 // encoding, and streams the result to this Message object.
3312 Message& operator <<(const ::wstring& wstr);
3313#endif // GTEST_HAS_GLOBAL_WSTRING
3314
3315 // Gets the text streamed to this object so far as an std::string.
3316 // Each '\0' character in the buffer is replaced with "\\0".
3317 //
3318 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
3319 std::string GetString() const;
3320
3321 private:
3322
3323#if GTEST_OS_SYMBIAN
3324 // These are needed as the Nokia Symbian Compiler cannot decide between
3325 // const T& and const T* in a function template. The Nokia compiler _can_
3326 // decide between class template specializations for T and T*, so a
3327 // tr1::type_traits-like is_pointer works, and we can overload on that.
3328 template <typename T>
3329 inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
3330 if (pointer == NULL) {
3331 *ss_ << "(null)";
3332 } else {
3333 *ss_ << pointer;
3334 }
3335 }
3336 template <typename T>
3337 inline void StreamHelper(internal::false_type /*is_pointer*/,
3338 const T& value) {
3339 // See the comments in Message& operator <<(const T&) above for why
3340 // we need this using statement.
3341 using ::operator <<;
3342 *ss_ << value;
3343 }
3344#endif // GTEST_OS_SYMBIAN
3345
3346 // We'll hold the text streamed to this object here.
3347 const internal::scoped_ptr< ::std::stringstream> ss_;
3348
3349 // We declare (but don't implement) this to prevent the compiler
3350 // from implementing the assignment operator.
3351 void operator=(const Message&);
3352};
3353
3354// Streams a Message to an ostream.
3355inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
3356 return os << sb.GetString();
3357}
3358
3359namespace internal {
3360
3361// Converts a streamable value to an std::string. A NULL pointer is
3362// converted to "(null)". When the input value is a ::string,
3363// ::std::string, ::wstring, or ::std::wstring object, each NUL
3364// character in it is replaced with "\\0".
3365template <typename T>
3366std::string StreamableToString(const T& streamable) {
3367 return (Message() << streamable).GetString();
3368}
3369
3370} // namespace internal
3371} // namespace testing
3372
3373#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3374// Copyright 2005, Google Inc.
3375// All rights reserved.
3376//
3377// Redistribution and use in source and binary forms, with or without
3378// modification, are permitted provided that the following conditions are
3379// met:
3380//
3381// * Redistributions of source code must retain the above copyright
3382// notice, this list of conditions and the following disclaimer.
3383// * Redistributions in binary form must reproduce the above
3384// copyright notice, this list of conditions and the following disclaimer
3385// in the documentation and/or other materials provided with the
3386// distribution.
3387// * Neither the name of Google Inc. nor the names of its
3388// contributors may be used to endorse or promote products derived from
3389// this software without specific prior written permission.
3390//
3391// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3392// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3393// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3394// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3395// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3396// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3397// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3398// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3399// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3400// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3401// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3402//
3403// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
3404//
3405// The Google C++ Testing Framework (Google Test)
3406//
3407// This header file declares the String class and functions used internally by
3408// Google Test. They are subject to change without notice. They should not used
3409// by code external to Google Test.
3410//
3411// This header file is #included by <gtest/internal/gtest-internal.h>.
3412// It should not be #included by other files.
3413
3414#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3415#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3416
3417#ifdef __BORLANDC__
3418// string.h is not guaranteed to provide strcpy on C++ Builder.
3419# include <mem.h>
3420#endif
3421
3422#include <string.h>
3423#include <string>
3424
3425
3426namespace testing {
3427namespace internal {
3428
3429// String - an abstract class holding static string utilities.
3430class GTEST_API_ String {
3431 public:
3432 // Static utility methods
3433
3434 // Clones a 0-terminated C string, allocating memory using new. The
3435 // caller is responsible for deleting the return value using
3436 // delete[]. Returns the cloned string, or NULL if the input is
3437 // NULL.
3438 //
3439 // This is different from strdup() in string.h, which allocates
3440 // memory using malloc().
3441 static const char* CloneCString(const char* c_str);
3442
3443#if GTEST_OS_WINDOWS_MOBILE
3444 // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
3445 // able to pass strings to Win32 APIs on CE we need to convert them
3446 // to 'Unicode', UTF-16.
3447
3448 // Creates a UTF-16 wide string from the given ANSI string, allocating
3449 // memory using new. The caller is responsible for deleting the return
3450 // value using delete[]. Returns the wide string, or NULL if the
3451 // input is NULL.
3452 //
3453 // The wide string is created using the ANSI codepage (CP_ACP) to
3454 // match the behaviour of the ANSI versions of Win32 calls and the
3455 // C runtime.
3456 static LPCWSTR AnsiToUtf16(const char* c_str);
3457
3458 // Creates an ANSI string from the given wide string, allocating
3459 // memory using new. The caller is responsible for deleting the return
3460 // value using delete[]. Returns the ANSI string, or NULL if the
3461 // input is NULL.
3462 //
3463 // The returned string is created using the ANSI codepage (CP_ACP) to
3464 // match the behaviour of the ANSI versions of Win32 calls and the
3465 // C runtime.
3466 static const char* Utf16ToAnsi(LPCWSTR utf16_str);
3467#endif
3468
3469 // Compares two C strings. Returns true iff they have the same content.
3470 //
3471 // Unlike strcmp(), this function can handle NULL argument(s). A
3472 // NULL C string is considered different to any non-NULL C string,
3473 // including the empty string.
3474 static bool CStringEquals(const char* lhs, const char* rhs);
3475
3476 // Converts a wide C string to a String using the UTF-8 encoding.
3477 // NULL will be converted to "(null)". If an error occurred during
3478 // the conversion, "(failed to convert from wide string)" is
3479 // returned.
3480 static std::string ShowWideCString(const wchar_t* wide_c_str);
3481
3482 // Compares two wide C strings. Returns true iff they have the same
3483 // content.
3484 //
3485 // Unlike wcscmp(), this function can handle NULL argument(s). A
3486 // NULL C string is considered different to any non-NULL C string,
3487 // including the empty string.
3488 static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
3489
3490 // Compares two C strings, ignoring case. Returns true iff they
3491 // have the same content.
3492 //
3493 // Unlike strcasecmp(), this function can handle NULL argument(s).
3494 // A NULL C string is considered different to any non-NULL C string,
3495 // including the empty string.
3496 static bool CaseInsensitiveCStringEquals(const char* lhs,
3497 const char* rhs);
3498
3499 // Compares two wide C strings, ignoring case. Returns true iff they
3500 // have the same content.
3501 //
3502 // Unlike wcscasecmp(), this function can handle NULL argument(s).
3503 // A NULL C string is considered different to any non-NULL wide C string,
3504 // including the empty string.
3505 // NB: The implementations on different platforms slightly differ.
3506 // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
3507 // environment variable. On GNU platform this method uses wcscasecmp
3508 // which compares according to LC_CTYPE category of the current locale.
3509 // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
3510 // current locale.
3511 static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
3512 const wchar_t* rhs);
3513
3514 // Returns true iff the given string ends with the given suffix, ignoring
3515 // case. Any string is considered to end with an empty suffix.
3516 static bool EndsWithCaseInsensitive(
3517 const std::string& str, const std::string& suffix);
3518
3519 // Formats an int value as "%02d".
3520 static std::string FormatIntWidth2(int value); // "%02d" for width == 2
3521
3522 // Formats an int value as "%X".
3523 static std::string FormatHexInt(int value);
3524
3525 // Formats a byte as "%02X".
3526 static std::string FormatByte(unsigned char value);
3527
3528 private:
3529 String(); // Not meant to be instantiated.
3530}; // class String
3531
3532// Gets the content of the stringstream's buffer as an std::string. Each '\0'
3533// character in the buffer is replaced with "\\0".
3534GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
3535
3536} // namespace internal
3537} // namespace testing
3538
3539#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3540// Copyright 2008, Google Inc.
3541// All rights reserved.
3542//
3543// Redistribution and use in source and binary forms, with or without
3544// modification, are permitted provided that the following conditions are
3545// met:
3546//
3547// * Redistributions of source code must retain the above copyright
3548// notice, this list of conditions and the following disclaimer.
3549// * Redistributions in binary form must reproduce the above
3550// copyright notice, this list of conditions and the following disclaimer
3551// in the documentation and/or other materials provided with the
3552// distribution.
3553// * Neither the name of Google Inc. nor the names of its
3554// contributors may be used to endorse or promote products derived from
3555// this software without specific prior written permission.
3556//
3557// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3558// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3559// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3560// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3561// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3562// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3563// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3564// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3565// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3566// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3567// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3568//
3569// Author: keith.ray@gmail.com (Keith Ray)
3570//
3571// Google Test filepath utilities
3572//
3573// This header file declares classes and functions used internally by
3574// Google Test. They are subject to change without notice.
3575//
3576// This file is #included in <gtest/internal/gtest-internal.h>.
3577// Do not include this header file separately!
3578
3579#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3580#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3581
3582
3583namespace testing {
3584namespace internal {
3585
3586// FilePath - a class for file and directory pathname manipulation which
3587// handles platform-specific conventions (like the pathname separator).
3588// Used for helper functions for naming files in a directory for xml output.
3589// Except for Set methods, all methods are const or static, which provides an
3590// "immutable value object" -- useful for peace of mind.
3591// A FilePath with a value ending in a path separator ("like/this/") represents
3592// a directory, otherwise it is assumed to represent a file. In either case,
3593// it may or may not represent an actual file or directory in the file system.
3594// Names are NOT checked for syntax correctness -- no checking for illegal
3595// characters, malformed paths, etc.
3596
3597class GTEST_API_ FilePath {
3598 public:
3599 FilePath() : pathname_("") { }
3600 FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
3601
3602 explicit FilePath(const std::string& pathname) : pathname_(pathname) {
3603 Normalize();
3604 }
3605
3606 FilePath& operator=(const FilePath& rhs) {
3607 Set(rhs);
3608 return *this;
3609 }
3610
3611 void Set(const FilePath& rhs) {
3612 pathname_ = rhs.pathname_;
3613 }
3614
3615 const std::string& string() const { return pathname_; }
3616 const char* c_str() const { return pathname_.c_str(); }
3617
3618 // Returns the current working directory, or "" if unsuccessful.
3619 static FilePath GetCurrentDir();
3620
3621 // Given directory = "dir", base_name = "test", number = 0,
3622 // extension = "xml", returns "dir/test.xml". If number is greater
3623 // than zero (e.g., 12), returns "dir/test_12.xml".
3624 // On Windows platform, uses \ as the separator rather than /.
3625 static FilePath MakeFileName(const FilePath& directory,
3626 const FilePath& base_name,
3627 int number,
3628 const char* extension);
3629
3630 // Given directory = "dir", relative_path = "test.xml",
3631 // returns "dir/test.xml".
3632 // On Windows, uses \ as the separator rather than /.
3633 static FilePath ConcatPaths(const FilePath& directory,
3634 const FilePath& relative_path);
3635
3636 // Returns a pathname for a file that does not currently exist. The pathname
3637 // will be directory/base_name.extension or
3638 // directory/base_name_<number>.extension if directory/base_name.extension
3639 // already exists. The number will be incremented until a pathname is found
3640 // that does not already exist.
3641 // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
3642 // There could be a race condition if two or more processes are calling this
3643 // function at the same time -- they could both pick the same filename.
3644 static FilePath GenerateUniqueFileName(const FilePath& directory,
3645 const FilePath& base_name,
3646 const char* extension);
3647
3648 // Returns true iff the path is "".
3649 bool IsEmpty() const { return pathname_.empty(); }
3650
3651 // If input name has a trailing separator character, removes it and returns
3652 // the name, otherwise return the name string unmodified.
3653 // On Windows platform, uses \ as the separator, other platforms use /.
3654 FilePath RemoveTrailingPathSeparator() const;
3655
3656 // Returns a copy of the FilePath with the directory part removed.
3657 // Example: FilePath("path/to/file").RemoveDirectoryName() returns
3658 // FilePath("file"). If there is no directory part ("just_a_file"), it returns
3659 // the FilePath unmodified. If there is no file part ("just_a_dir/") it
3660 // returns an empty FilePath ("").
3661 // On Windows platform, '\' is the path separator, otherwise it is '/'.
3662 FilePath RemoveDirectoryName() const;
3663
3664 // RemoveFileName returns the directory path with the filename removed.
3665 // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
3666 // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
3667 // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
3668 // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
3669 // On Windows platform, '\' is the path separator, otherwise it is '/'.
3670 FilePath RemoveFileName() const;
3671
3672 // Returns a copy of the FilePath with the case-insensitive extension removed.
3673 // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
3674 // FilePath("dir/file"). If a case-insensitive extension is not
3675 // found, returns a copy of the original FilePath.
3676 FilePath RemoveExtension(const char* extension) const;
3677
3678 // Creates directories so that path exists. Returns true if successful or if
3679 // the directories already exist; returns false if unable to create
3680 // directories for any reason. Will also return false if the FilePath does
3681 // not represent a directory (that is, it doesn't end with a path separator).
3682 bool CreateDirectoriesRecursively() const;
3683
3684 // Create the directory so that path exists. Returns true if successful or
3685 // if the directory already exists; returns false if unable to create the
3686 // directory for any reason, including if the parent directory does not
3687 // exist. Not named "CreateDirectory" because that's a macro on Windows.
3688 bool CreateFolder() const;
3689
3690 // Returns true if FilePath describes something in the file-system,
3691 // either a file, directory, or whatever, and that something exists.
3692 bool FileOrDirectoryExists() const;
3693
3694 // Returns true if pathname describes a directory in the file-system
3695 // that exists.
3696 bool DirectoryExists() const;
3697
3698 // Returns true if FilePath ends with a path separator, which indicates that
3699 // it is intended to represent a directory. Returns false otherwise.
3700 // This does NOT check that a directory (or file) actually exists.
3701 bool IsDirectory() const;
3702
3703 // Returns true if pathname describes a root directory. (Windows has one
3704 // root directory per disk drive.)
3705 bool IsRootDirectory() const;
3706
3707 // Returns true if pathname describes an absolute path.
3708 bool IsAbsolutePath() const;
3709
3710 private:
3711 // Replaces multiple consecutive separators with a single separator.
3712 // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
3713 // redundancies that might be in a pathname involving "." or "..".
3714 //
3715 // A pathname with multiple consecutive separators may occur either through
3716 // user error or as a result of some scripts or APIs that generate a pathname
3717 // with a trailing separator. On other platforms the same API or script
3718 // may NOT generate a pathname with a trailing "/". Then elsewhere that
3719 // pathname may have another "/" and pathname components added to it,
3720 // without checking for the separator already being there.
3721 // The script language and operating system may allow paths like "foo//bar"
3722 // but some of the functions in FilePath will not handle that correctly. In
3723 // particular, RemoveTrailingPathSeparator() only removes one separator, and
3724 // it is called in CreateDirectoriesRecursively() assuming that it will change
3725 // a pathname from directory syntax (trailing separator) to filename syntax.
3726 //
3727 // On Windows this method also replaces the alternate path separator '/' with
3728 // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
3729 // "bar\\foo".
3730
3731 void Normalize();
3732
3733 // Returns a pointer to the last occurence of a valid path separator in
3734 // the FilePath. On Windows, for example, both '/' and '\' are valid path
3735 // separators. Returns NULL if no path separator was found.
3736 const char* FindLastPathSeparator() const;
3737
3738 std::string pathname_;
3739}; // class FilePath
3740
3741} // namespace internal
3742} // namespace testing
3743
3744#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3745// This file was GENERATED by command:
3746// pump.py gtest-type-util.h.pump
3747// DO NOT EDIT BY HAND!!!
3748
3749// Copyright 2008 Google Inc.
3750// All Rights Reserved.
3751//
3752// Redistribution and use in source and binary forms, with or without
3753// modification, are permitted provided that the following conditions are
3754// met:
3755//
3756// * Redistributions of source code must retain the above copyright
3757// notice, this list of conditions and the following disclaimer.
3758// * Redistributions in binary form must reproduce the above
3759// copyright notice, this list of conditions and the following disclaimer
3760// in the documentation and/or other materials provided with the
3761// distribution.
3762// * Neither the name of Google Inc. nor the names of its
3763// contributors may be used to endorse or promote products derived from
3764// this software without specific prior written permission.
3765//
3766// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3767// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3768// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3769// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3770// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3771// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3772// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3773// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3774// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3775// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3776// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3777//
3778// Author: wan@google.com (Zhanyong Wan)
3779
3780// Type utilities needed for implementing typed and type-parameterized
3781// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
3782//
3783// Currently we support at most 50 types in a list, and at most 50
3784// type-parameterized tests in one type-parameterized test case.
3785// Please contact googletestframework@googlegroups.com if you need
3786// more.
3787
3788#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3789#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3790
3791
3792// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
3793// libstdc++ (which is where cxxabi.h comes from).
3794# if GTEST_HAS_CXXABI_H_
3795# include <cxxabi.h>
3796# elif defined(__HP_aCC)
3797# include <acxx_demangle.h>
3798# endif // GTEST_HASH_CXXABI_H_
3799
3800namespace testing {
3801namespace internal {
3802
3803// GetTypeName<T>() returns a human-readable name of type T.
3804// NB: This function is also used in Google Mock, so don't move it inside of
3805// the typed-test-only section below.
3806template <typename T>
3807std::string GetTypeName() {
3808# if GTEST_HAS_RTTI
3809
3810 const char* const name = typeid(T).name();
3811# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
3812 int status = 0;
3813 // gcc's implementation of typeid(T).name() mangles the type name,
3814 // so we have to demangle it.
3815# if GTEST_HAS_CXXABI_H_
3816 using abi::__cxa_demangle;
3817# endif // GTEST_HAS_CXXABI_H_
3818 char* const readable_name = __cxa_demangle(name, 0, 0, &status);
3819 const std::string name_str(status == 0 ? readable_name : name);
3820 free(readable_name);
3821 return name_str;
3822# else
3823 return name;
3824# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
3825
3826# else
3827
3828 return "<type>";
3829
3830# endif // GTEST_HAS_RTTI
3831}
3832
3833#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
3834
3835// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
3836// type. This can be used as a compile-time assertion to ensure that
3837// two types are equal.
3838
3839template <typename T1, typename T2>
3840struct AssertTypeEq;
3841
3842template <typename T>
3843struct AssertTypeEq<T, T> {
3844 typedef bool type;
3845};
3846
3847// A unique type used as the default value for the arguments of class
3848// template Types. This allows us to simulate variadic templates
3849// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
3850// support directly.
3851struct None {};
3852
3853// The following family of struct and struct templates are used to
3854// represent type lists. In particular, TypesN<T1, T2, ..., TN>
3855// represents a type list with N types (T1, T2, ..., and TN) in it.
3856// Except for Types0, every struct in the family has two member types:
3857// Head for the first type in the list, and Tail for the rest of the
3858// list.
3859
3860// The empty type list.
3861struct Types0 {};
3862
3863// Type lists of length 1, 2, 3, and so on.
3864
3865template <typename T1>
3866struct Types1 {
3867 typedef T1 Head;
3868 typedef Types0 Tail;
3869};
3870template <typename T1, typename T2>
3871struct Types2 {
3872 typedef T1 Head;
3873 typedef Types1<T2> Tail;
3874};
3875
3876template <typename T1, typename T2, typename T3>
3877struct Types3 {
3878 typedef T1 Head;
3879 typedef Types2<T2, T3> Tail;
3880};
3881
3882template <typename T1, typename T2, typename T3, typename T4>
3883struct Types4 {
3884 typedef T1 Head;
3885 typedef Types3<T2, T3, T4> Tail;
3886};
3887
3888template <typename T1, typename T2, typename T3, typename T4, typename T5>
3889struct Types5 {
3890 typedef T1 Head;
3891 typedef Types4<T2, T3, T4, T5> Tail;
3892};
3893
3894template <typename T1, typename T2, typename T3, typename T4, typename T5,
3895 typename T6>
3896struct Types6 {
3897 typedef T1 Head;
3898 typedef Types5<T2, T3, T4, T5, T6> Tail;
3899};
3900
3901template <typename T1, typename T2, typename T3, typename T4, typename T5,
3902 typename T6, typename T7>
3903struct Types7 {
3904 typedef T1 Head;
3905 typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
3906};
3907
3908template <typename T1, typename T2, typename T3, typename T4, typename T5,
3909 typename T6, typename T7, typename T8>
3910struct Types8 {
3911 typedef T1 Head;
3912 typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
3913};
3914
3915template <typename T1, typename T2, typename T3, typename T4, typename T5,
3916 typename T6, typename T7, typename T8, typename T9>
3917struct Types9 {
3918 typedef T1 Head;
3919 typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
3920};
3921
3922template <typename T1, typename T2, typename T3, typename T4, typename T5,
3923 typename T6, typename T7, typename T8, typename T9, typename T10>
3924struct Types10 {
3925 typedef T1 Head;
3926 typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
3927};
3928
3929template <typename T1, typename T2, typename T3, typename T4, typename T5,
3930 typename T6, typename T7, typename T8, typename T9, typename T10,
3931 typename T11>
3932struct Types11 {
3933 typedef T1 Head;
3934 typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
3935};
3936
3937template <typename T1, typename T2, typename T3, typename T4, typename T5,
3938 typename T6, typename T7, typename T8, typename T9, typename T10,
3939 typename T11, typename T12>
3940struct Types12 {
3941 typedef T1 Head;
3942 typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
3943};
3944
3945template <typename T1, typename T2, typename T3, typename T4, typename T5,
3946 typename T6, typename T7, typename T8, typename T9, typename T10,
3947 typename T11, typename T12, typename T13>
3948struct Types13 {
3949 typedef T1 Head;
3950 typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
3951};
3952
3953template <typename T1, typename T2, typename T3, typename T4, typename T5,
3954 typename T6, typename T7, typename T8, typename T9, typename T10,
3955 typename T11, typename T12, typename T13, typename T14>
3956struct Types14 {
3957 typedef T1 Head;
3958 typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
3959};
3960
3961template <typename T1, typename T2, typename T3, typename T4, typename T5,
3962 typename T6, typename T7, typename T8, typename T9, typename T10,
3963 typename T11, typename T12, typename T13, typename T14, typename T15>
3964struct Types15 {
3965 typedef T1 Head;
3966 typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
3967 T15> Tail;
3968};
3969
3970template <typename T1, typename T2, typename T3, typename T4, typename T5,
3971 typename T6, typename T7, typename T8, typename T9, typename T10,
3972 typename T11, typename T12, typename T13, typename T14, typename T15,
3973 typename T16>
3974struct Types16 {
3975 typedef T1 Head;
3976 typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3977 T16> Tail;
3978};
3979
3980template <typename T1, typename T2, typename T3, typename T4, typename T5,
3981 typename T6, typename T7, typename T8, typename T9, typename T10,
3982 typename T11, typename T12, typename T13, typename T14, typename T15,
3983 typename T16, typename T17>
3984struct Types17 {
3985 typedef T1 Head;
3986 typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3987 T16, T17> Tail;
3988};
3989
3990template <typename T1, typename T2, typename T3, typename T4, typename T5,
3991 typename T6, typename T7, typename T8, typename T9, typename T10,
3992 typename T11, typename T12, typename T13, typename T14, typename T15,
3993 typename T16, typename T17, typename T18>
3994struct Types18 {
3995 typedef T1 Head;
3996 typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3997 T16, T17, T18> Tail;
3998};
3999
4000template <typename T1, typename T2, typename T3, typename T4, typename T5,
4001 typename T6, typename T7, typename T8, typename T9, typename T10,
4002 typename T11, typename T12, typename T13, typename T14, typename T15,
4003 typename T16, typename T17, typename T18, typename T19>
4004struct Types19 {
4005 typedef T1 Head;
4006 typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4007 T16, T17, T18, T19> Tail;
4008};
4009
4010template <typename T1, typename T2, typename T3, typename T4, typename T5,
4011 typename T6, typename T7, typename T8, typename T9, typename T10,
4012 typename T11, typename T12, typename T13, typename T14, typename T15,
4013 typename T16, typename T17, typename T18, typename T19, typename T20>
4014struct Types20 {
4015 typedef T1 Head;
4016 typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4017 T16, T17, T18, T19, T20> Tail;
4018};
4019
4020template <typename T1, typename T2, typename T3, typename T4, typename T5,
4021 typename T6, typename T7, typename T8, typename T9, typename T10,
4022 typename T11, typename T12, typename T13, typename T14, typename T15,
4023 typename T16, typename T17, typename T18, typename T19, typename T20,
4024 typename T21>
4025struct Types21 {
4026 typedef T1 Head;
4027 typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4028 T16, T17, T18, T19, T20, T21> Tail;
4029};
4030
4031template <typename T1, typename T2, typename T3, typename T4, typename T5,
4032 typename T6, typename T7, typename T8, typename T9, typename T10,
4033 typename T11, typename T12, typename T13, typename T14, typename T15,
4034 typename T16, typename T17, typename T18, typename T19, typename T20,
4035 typename T21, typename T22>
4036struct Types22 {
4037 typedef T1 Head;
4038 typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4039 T16, T17, T18, T19, T20, T21, T22> Tail;
4040};
4041
4042template <typename T1, typename T2, typename T3, typename T4, typename T5,
4043 typename T6, typename T7, typename T8, typename T9, typename T10,
4044 typename T11, typename T12, typename T13, typename T14, typename T15,
4045 typename T16, typename T17, typename T18, typename T19, typename T20,
4046 typename T21, typename T22, typename T23>
4047struct Types23 {
4048 typedef T1 Head;
4049 typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4050 T16, T17, T18, T19, T20, T21, T22, T23> Tail;
4051};
4052
4053template <typename T1, typename T2, typename T3, typename T4, typename T5,
4054 typename T6, typename T7, typename T8, typename T9, typename T10,
4055 typename T11, typename T12, typename T13, typename T14, typename T15,
4056 typename T16, typename T17, typename T18, typename T19, typename T20,
4057 typename T21, typename T22, typename T23, typename T24>
4058struct Types24 {
4059 typedef T1 Head;
4060 typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4061 T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
4062};
4063
4064template <typename T1, typename T2, typename T3, typename T4, typename T5,
4065 typename T6, typename T7, typename T8, typename T9, typename T10,
4066 typename T11, typename T12, typename T13, typename T14, typename T15,
4067 typename T16, typename T17, typename T18, typename T19, typename T20,
4068 typename T21, typename T22, typename T23, typename T24, typename T25>
4069struct Types25 {
4070 typedef T1 Head;
4071 typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4072 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
4073};
4074
4075template <typename T1, typename T2, typename T3, typename T4, typename T5,
4076 typename T6, typename T7, typename T8, typename T9, typename T10,
4077 typename T11, typename T12, typename T13, typename T14, typename T15,
4078 typename T16, typename T17, typename T18, typename T19, typename T20,
4079 typename T21, typename T22, typename T23, typename T24, typename T25,
4080 typename T26>
4081struct Types26 {
4082 typedef T1 Head;
4083 typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4084 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
4085};
4086
4087template <typename T1, typename T2, typename T3, typename T4, typename T5,
4088 typename T6, typename T7, typename T8, typename T9, typename T10,
4089 typename T11, typename T12, typename T13, typename T14, typename T15,
4090 typename T16, typename T17, typename T18, typename T19, typename T20,
4091 typename T21, typename T22, typename T23, typename T24, typename T25,
4092 typename T26, typename T27>
4093struct Types27 {
4094 typedef T1 Head;
4095 typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4096 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
4097};
4098
4099template <typename T1, typename T2, typename T3, typename T4, typename T5,
4100 typename T6, typename T7, typename T8, typename T9, typename T10,
4101 typename T11, typename T12, typename T13, typename T14, typename T15,
4102 typename T16, typename T17, typename T18, typename T19, typename T20,
4103 typename T21, typename T22, typename T23, typename T24, typename T25,
4104 typename T26, typename T27, typename T28>
4105struct Types28 {
4106 typedef T1 Head;
4107 typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4108 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
4109};
4110
4111template <typename T1, typename T2, typename T3, typename T4, typename T5,
4112 typename T6, typename T7, typename T8, typename T9, typename T10,
4113 typename T11, typename T12, typename T13, typename T14, typename T15,
4114 typename T16, typename T17, typename T18, typename T19, typename T20,
4115 typename T21, typename T22, typename T23, typename T24, typename T25,
4116 typename T26, typename T27, typename T28, typename T29>
4117struct Types29 {
4118 typedef T1 Head;
4119 typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4120 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
4121 T29> Tail;
4122};
4123
4124template <typename T1, typename T2, typename T3, typename T4, typename T5,
4125 typename T6, typename T7, typename T8, typename T9, typename T10,
4126 typename T11, typename T12, typename T13, typename T14, typename T15,
4127 typename T16, typename T17, typename T18, typename T19, typename T20,
4128 typename T21, typename T22, typename T23, typename T24, typename T25,
4129 typename T26, typename T27, typename T28, typename T29, typename T30>
4130struct Types30 {
4131 typedef T1 Head;
4132 typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4133 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4134 T30> Tail;
4135};
4136
4137template <typename T1, typename T2, typename T3, typename T4, typename T5,
4138 typename T6, typename T7, typename T8, typename T9, typename T10,
4139 typename T11, typename T12, typename T13, typename T14, typename T15,
4140 typename T16, typename T17, typename T18, typename T19, typename T20,
4141 typename T21, typename T22, typename T23, typename T24, typename T25,
4142 typename T26, typename T27, typename T28, typename T29, typename T30,
4143 typename T31>
4144struct Types31 {
4145 typedef T1 Head;
4146 typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4147 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4148 T30, T31> Tail;
4149};
4150
4151template <typename T1, typename T2, typename T3, typename T4, typename T5,
4152 typename T6, typename T7, typename T8, typename T9, typename T10,
4153 typename T11, typename T12, typename T13, typename T14, typename T15,
4154 typename T16, typename T17, typename T18, typename T19, typename T20,
4155 typename T21, typename T22, typename T23, typename T24, typename T25,
4156 typename T26, typename T27, typename T28, typename T29, typename T30,
4157 typename T31, typename T32>
4158struct Types32 {
4159 typedef T1 Head;
4160 typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4161 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4162 T30, T31, T32> Tail;
4163};
4164
4165template <typename T1, typename T2, typename T3, typename T4, typename T5,
4166 typename T6, typename T7, typename T8, typename T9, typename T10,
4167 typename T11, typename T12, typename T13, typename T14, typename T15,
4168 typename T16, typename T17, typename T18, typename T19, typename T20,
4169 typename T21, typename T22, typename T23, typename T24, typename T25,
4170 typename T26, typename T27, typename T28, typename T29, typename T30,
4171 typename T31, typename T32, typename T33>
4172struct Types33 {
4173 typedef T1 Head;
4174 typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4175 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4176 T30, T31, T32, T33> Tail;
4177};
4178
4179template <typename T1, typename T2, typename T3, typename T4, typename T5,
4180 typename T6, typename T7, typename T8, typename T9, typename T10,
4181 typename T11, typename T12, typename T13, typename T14, typename T15,
4182 typename T16, typename T17, typename T18, typename T19, typename T20,
4183 typename T21, typename T22, typename T23, typename T24, typename T25,
4184 typename T26, typename T27, typename T28, typename T29, typename T30,
4185 typename T31, typename T32, typename T33, typename T34>
4186struct Types34 {
4187 typedef T1 Head;
4188 typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4189 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4190 T30, T31, T32, T33, T34> Tail;
4191};
4192
4193template <typename T1, typename T2, typename T3, typename T4, typename T5,
4194 typename T6, typename T7, typename T8, typename T9, typename T10,
4195 typename T11, typename T12, typename T13, typename T14, typename T15,
4196 typename T16, typename T17, typename T18, typename T19, typename T20,
4197 typename T21, typename T22, typename T23, typename T24, typename T25,
4198 typename T26, typename T27, typename T28, typename T29, typename T30,
4199 typename T31, typename T32, typename T33, typename T34, typename T35>
4200struct Types35 {
4201 typedef T1 Head;
4202 typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4203 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4204 T30, T31, T32, T33, T34, T35> Tail;
4205};
4206
4207template <typename T1, typename T2, typename T3, typename T4, typename T5,
4208 typename T6, typename T7, typename T8, typename T9, typename T10,
4209 typename T11, typename T12, typename T13, typename T14, typename T15,
4210 typename T16, typename T17, typename T18, typename T19, typename T20,
4211 typename T21, typename T22, typename T23, typename T24, typename T25,
4212 typename T26, typename T27, typename T28, typename T29, typename T30,
4213 typename T31, typename T32, typename T33, typename T34, typename T35,
4214 typename T36>
4215struct Types36 {
4216 typedef T1 Head;
4217 typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4218 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4219 T30, T31, T32, T33, T34, T35, T36> Tail;
4220};
4221
4222template <typename T1, typename T2, typename T3, typename T4, typename T5,
4223 typename T6, typename T7, typename T8, typename T9, typename T10,
4224 typename T11, typename T12, typename T13, typename T14, typename T15,
4225 typename T16, typename T17, typename T18, typename T19, typename T20,
4226 typename T21, typename T22, typename T23, typename T24, typename T25,
4227 typename T26, typename T27, typename T28, typename T29, typename T30,
4228 typename T31, typename T32, typename T33, typename T34, typename T35,
4229 typename T36, typename T37>
4230struct Types37 {
4231 typedef T1 Head;
4232 typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4233 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4234 T30, T31, T32, T33, T34, T35, T36, T37> Tail;
4235};
4236
4237template <typename T1, typename T2, typename T3, typename T4, typename T5,
4238 typename T6, typename T7, typename T8, typename T9, typename T10,
4239 typename T11, typename T12, typename T13, typename T14, typename T15,
4240 typename T16, typename T17, typename T18, typename T19, typename T20,
4241 typename T21, typename T22, typename T23, typename T24, typename T25,
4242 typename T26, typename T27, typename T28, typename T29, typename T30,
4243 typename T31, typename T32, typename T33, typename T34, typename T35,
4244 typename T36, typename T37, typename T38>
4245struct Types38 {
4246 typedef T1 Head;
4247 typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4248 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4249 T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
4250};
4251
4252template <typename T1, typename T2, typename T3, typename T4, typename T5,
4253 typename T6, typename T7, typename T8, typename T9, typename T10,
4254 typename T11, typename T12, typename T13, typename T14, typename T15,
4255 typename T16, typename T17, typename T18, typename T19, typename T20,
4256 typename T21, typename T22, typename T23, typename T24, typename T25,
4257 typename T26, typename T27, typename T28, typename T29, typename T30,
4258 typename T31, typename T32, typename T33, typename T34, typename T35,
4259 typename T36, typename T37, typename T38, typename T39>
4260struct Types39 {
4261 typedef T1 Head;
4262 typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4263 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4264 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
4265};
4266
4267template <typename T1, typename T2, typename T3, typename T4, typename T5,
4268 typename T6, typename T7, typename T8, typename T9, typename T10,
4269 typename T11, typename T12, typename T13, typename T14, typename T15,
4270 typename T16, typename T17, typename T18, typename T19, typename T20,
4271 typename T21, typename T22, typename T23, typename T24, typename T25,
4272 typename T26, typename T27, typename T28, typename T29, typename T30,
4273 typename T31, typename T32, typename T33, typename T34, typename T35,
4274 typename T36, typename T37, typename T38, typename T39, typename T40>
4275struct Types40 {
4276 typedef T1 Head;
4277 typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4278 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4279 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
4280};
4281
4282template <typename T1, typename T2, typename T3, typename T4, typename T5,
4283 typename T6, typename T7, typename T8, typename T9, typename T10,
4284 typename T11, typename T12, typename T13, typename T14, typename T15,
4285 typename T16, typename T17, typename T18, typename T19, typename T20,
4286 typename T21, typename T22, typename T23, typename T24, typename T25,
4287 typename T26, typename T27, typename T28, typename T29, typename T30,
4288 typename T31, typename T32, typename T33, typename T34, typename T35,
4289 typename T36, typename T37, typename T38, typename T39, typename T40,
4290 typename T41>
4291struct Types41 {
4292 typedef T1 Head;
4293 typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4294 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4295 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
4296};
4297
4298template <typename T1, typename T2, typename T3, typename T4, typename T5,
4299 typename T6, typename T7, typename T8, typename T9, typename T10,
4300 typename T11, typename T12, typename T13, typename T14, typename T15,
4301 typename T16, typename T17, typename T18, typename T19, typename T20,
4302 typename T21, typename T22, typename T23, typename T24, typename T25,
4303 typename T26, typename T27, typename T28, typename T29, typename T30,
4304 typename T31, typename T32, typename T33, typename T34, typename T35,
4305 typename T36, typename T37, typename T38, typename T39, typename T40,
4306 typename T41, typename T42>
4307struct Types42 {
4308 typedef T1 Head;
4309 typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4310 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4311 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
4312};
4313
4314template <typename T1, typename T2, typename T3, typename T4, typename T5,
4315 typename T6, typename T7, typename T8, typename T9, typename T10,
4316 typename T11, typename T12, typename T13, typename T14, typename T15,
4317 typename T16, typename T17, typename T18, typename T19, typename T20,
4318 typename T21, typename T22, typename T23, typename T24, typename T25,
4319 typename T26, typename T27, typename T28, typename T29, typename T30,
4320 typename T31, typename T32, typename T33, typename T34, typename T35,
4321 typename T36, typename T37, typename T38, typename T39, typename T40,
4322 typename T41, typename T42, typename T43>
4323struct Types43 {
4324 typedef T1 Head;
4325 typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4326 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4327 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
4328 T43> Tail;
4329};
4330
4331template <typename T1, typename T2, typename T3, typename T4, typename T5,
4332 typename T6, typename T7, typename T8, typename T9, typename T10,
4333 typename T11, typename T12, typename T13, typename T14, typename T15,
4334 typename T16, typename T17, typename T18, typename T19, typename T20,
4335 typename T21, typename T22, typename T23, typename T24, typename T25,
4336 typename T26, typename T27, typename T28, typename T29, typename T30,
4337 typename T31, typename T32, typename T33, typename T34, typename T35,
4338 typename T36, typename T37, typename T38, typename T39, typename T40,
4339 typename T41, typename T42, typename T43, typename T44>
4340struct Types44 {
4341 typedef T1 Head;
4342 typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4343 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4344 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4345 T44> Tail;
4346};
4347
4348template <typename T1, typename T2, typename T3, typename T4, typename T5,
4349 typename T6, typename T7, typename T8, typename T9, typename T10,
4350 typename T11, typename T12, typename T13, typename T14, typename T15,
4351 typename T16, typename T17, typename T18, typename T19, typename T20,
4352 typename T21, typename T22, typename T23, typename T24, typename T25,
4353 typename T26, typename T27, typename T28, typename T29, typename T30,
4354 typename T31, typename T32, typename T33, typename T34, typename T35,
4355 typename T36, typename T37, typename T38, typename T39, typename T40,
4356 typename T41, typename T42, typename T43, typename T44, typename T45>
4357struct Types45 {
4358 typedef T1 Head;
4359 typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4360 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4361 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4362 T44, T45> Tail;
4363};
4364
4365template <typename T1, typename T2, typename T3, typename T4, typename T5,
4366 typename T6, typename T7, typename T8, typename T9, typename T10,
4367 typename T11, typename T12, typename T13, typename T14, typename T15,
4368 typename T16, typename T17, typename T18, typename T19, typename T20,
4369 typename T21, typename T22, typename T23, typename T24, typename T25,
4370 typename T26, typename T27, typename T28, typename T29, typename T30,
4371 typename T31, typename T32, typename T33, typename T34, typename T35,
4372 typename T36, typename T37, typename T38, typename T39, typename T40,
4373 typename T41, typename T42, typename T43, typename T44, typename T45,
4374 typename T46>
4375struct Types46 {
4376 typedef T1 Head;
4377 typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4378 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4379 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4380 T44, T45, T46> Tail;
4381};
4382
4383template <typename T1, typename T2, typename T3, typename T4, typename T5,
4384 typename T6, typename T7, typename T8, typename T9, typename T10,
4385 typename T11, typename T12, typename T13, typename T14, typename T15,
4386 typename T16, typename T17, typename T18, typename T19, typename T20,
4387 typename T21, typename T22, typename T23, typename T24, typename T25,
4388 typename T26, typename T27, typename T28, typename T29, typename T30,
4389 typename T31, typename T32, typename T33, typename T34, typename T35,
4390 typename T36, typename T37, typename T38, typename T39, typename T40,
4391 typename T41, typename T42, typename T43, typename T44, typename T45,
4392 typename T46, typename T47>
4393struct Types47 {
4394 typedef T1 Head;
4395 typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4396 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4397 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4398 T44, T45, T46, T47> Tail;
4399};
4400
4401template <typename T1, typename T2, typename T3, typename T4, typename T5,
4402 typename T6, typename T7, typename T8, typename T9, typename T10,
4403 typename T11, typename T12, typename T13, typename T14, typename T15,
4404 typename T16, typename T17, typename T18, typename T19, typename T20,
4405 typename T21, typename T22, typename T23, typename T24, typename T25,
4406 typename T26, typename T27, typename T28, typename T29, typename T30,
4407 typename T31, typename T32, typename T33, typename T34, typename T35,
4408 typename T36, typename T37, typename T38, typename T39, typename T40,
4409 typename T41, typename T42, typename T43, typename T44, typename T45,
4410 typename T46, typename T47, typename T48>
4411struct Types48 {
4412 typedef T1 Head;
4413 typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4414 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4415 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4416 T44, T45, T46, T47, T48> Tail;
4417};
4418
4419template <typename T1, typename T2, typename T3, typename T4, typename T5,
4420 typename T6, typename T7, typename T8, typename T9, typename T10,
4421 typename T11, typename T12, typename T13, typename T14, typename T15,
4422 typename T16, typename T17, typename T18, typename T19, typename T20,
4423 typename T21, typename T22, typename T23, typename T24, typename T25,
4424 typename T26, typename T27, typename T28, typename T29, typename T30,
4425 typename T31, typename T32, typename T33, typename T34, typename T35,
4426 typename T36, typename T37, typename T38, typename T39, typename T40,
4427 typename T41, typename T42, typename T43, typename T44, typename T45,
4428 typename T46, typename T47, typename T48, typename T49>
4429struct Types49 {
4430 typedef T1 Head;
4431 typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4432 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4433 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4434 T44, T45, T46, T47, T48, T49> Tail;
4435};
4436
4437template <typename T1, typename T2, typename T3, typename T4, typename T5,
4438 typename T6, typename T7, typename T8, typename T9, typename T10,
4439 typename T11, typename T12, typename T13, typename T14, typename T15,
4440 typename T16, typename T17, typename T18, typename T19, typename T20,
4441 typename T21, typename T22, typename T23, typename T24, typename T25,
4442 typename T26, typename T27, typename T28, typename T29, typename T30,
4443 typename T31, typename T32, typename T33, typename T34, typename T35,
4444 typename T36, typename T37, typename T38, typename T39, typename T40,
4445 typename T41, typename T42, typename T43, typename T44, typename T45,
4446 typename T46, typename T47, typename T48, typename T49, typename T50>
4447struct Types50 {
4448 typedef T1 Head;
4449 typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4450 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4451 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4452 T44, T45, T46, T47, T48, T49, T50> Tail;
4453};
4454
4455
4456} // namespace internal
4457
4458// We don't want to require the users to write TypesN<...> directly,
4459// as that would require them to count the length. Types<...> is much
4460// easier to write, but generates horrible messages when there is a
4461// compiler error, as gcc insists on printing out each template
4462// argument, even if it has the default value (this means Types<int>
4463// will appear as Types<int, None, None, ..., None> in the compiler
4464// errors).
4465//
4466// Our solution is to combine the best part of the two approaches: a
4467// user would write Types<T1, ..., TN>, and Google Test will translate
4468// that to TypesN<T1, ..., TN> internally to make error messages
4469// readable. The translation is done by the 'type' member of the
4470// Types template.
4471template <typename T1 = internal::None, typename T2 = internal::None,
4472 typename T3 = internal::None, typename T4 = internal::None,
4473 typename T5 = internal::None, typename T6 = internal::None,
4474 typename T7 = internal::None, typename T8 = internal::None,
4475 typename T9 = internal::None, typename T10 = internal::None,
4476 typename T11 = internal::None, typename T12 = internal::None,
4477 typename T13 = internal::None, typename T14 = internal::None,
4478 typename T15 = internal::None, typename T16 = internal::None,
4479 typename T17 = internal::None, typename T18 = internal::None,
4480 typename T19 = internal::None, typename T20 = internal::None,
4481 typename T21 = internal::None, typename T22 = internal::None,
4482 typename T23 = internal::None, typename T24 = internal::None,
4483 typename T25 = internal::None, typename T26 = internal::None,
4484 typename T27 = internal::None, typename T28 = internal::None,
4485 typename T29 = internal::None, typename T30 = internal::None,
4486 typename T31 = internal::None, typename T32 = internal::None,
4487 typename T33 = internal::None, typename T34 = internal::None,
4488 typename T35 = internal::None, typename T36 = internal::None,
4489 typename T37 = internal::None, typename T38 = internal::None,
4490 typename T39 = internal::None, typename T40 = internal::None,
4491 typename T41 = internal::None, typename T42 = internal::None,
4492 typename T43 = internal::None, typename T44 = internal::None,
4493 typename T45 = internal::None, typename T46 = internal::None,
4494 typename T47 = internal::None, typename T48 = internal::None,
4495 typename T49 = internal::None, typename T50 = internal::None>
4496struct Types {
4497 typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4498 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4499 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4500 T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
4501};
4502
4503template <>
4504struct Types<internal::None, internal::None, internal::None, internal::None,
4505 internal::None, internal::None, internal::None, internal::None,
4506 internal::None, internal::None, internal::None, internal::None,
4507 internal::None, internal::None, internal::None, internal::None,
4508 internal::None, internal::None, internal::None, internal::None,
4509 internal::None, internal::None, internal::None, internal::None,
4510 internal::None, internal::None, internal::None, internal::None,
4511 internal::None, internal::None, internal::None, internal::None,
4512 internal::None, internal::None, internal::None, internal::None,
4513 internal::None, internal::None, internal::None, internal::None,
4514 internal::None, internal::None, internal::None, internal::None,
4515 internal::None, internal::None, internal::None, internal::None,
4516 internal::None, internal::None> {
4517 typedef internal::Types0 type;
4518};
4519template <typename T1>
4520struct Types<T1, internal::None, internal::None, internal::None,
4521 internal::None, internal::None, internal::None, internal::None,
4522 internal::None, internal::None, internal::None, internal::None,
4523 internal::None, internal::None, internal::None, internal::None,
4524 internal::None, internal::None, internal::None, internal::None,
4525 internal::None, internal::None, internal::None, internal::None,
4526 internal::None, internal::None, internal::None, internal::None,
4527 internal::None, internal::None, internal::None, internal::None,
4528 internal::None, internal::None, internal::None, internal::None,
4529 internal::None, internal::None, internal::None, internal::None,
4530 internal::None, internal::None, internal::None, internal::None,
4531 internal::None, internal::None, internal::None, internal::None,
4532 internal::None, internal::None> {
4533 typedef internal::Types1<T1> type;
4534};
4535template <typename T1, typename T2>
4536struct Types<T1, T2, internal::None, internal::None, internal::None,
4537 internal::None, internal::None, internal::None, internal::None,
4538 internal::None, internal::None, internal::None, internal::None,
4539 internal::None, internal::None, internal::None, internal::None,
4540 internal::None, internal::None, internal::None, internal::None,
4541 internal::None, internal::None, internal::None, internal::None,
4542 internal::None, internal::None, internal::None, internal::None,
4543 internal::None, internal::None, internal::None, internal::None,
4544 internal::None, internal::None, internal::None, internal::None,
4545 internal::None, internal::None, internal::None, internal::None,
4546 internal::None, internal::None, internal::None, internal::None,
4547 internal::None, internal::None, internal::None, internal::None,
4548 internal::None> {
4549 typedef internal::Types2<T1, T2> type;
4550};
4551template <typename T1, typename T2, typename T3>
4552struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
4553 internal::None, internal::None, internal::None, internal::None,
4554 internal::None, internal::None, internal::None, internal::None,
4555 internal::None, internal::None, internal::None, internal::None,
4556 internal::None, internal::None, internal::None, internal::None,
4557 internal::None, internal::None, internal::None, internal::None,
4558 internal::None, internal::None, internal::None, internal::None,
4559 internal::None, internal::None, internal::None, internal::None,
4560 internal::None, internal::None, internal::None, internal::None,
4561 internal::None, internal::None, internal::None, internal::None,
4562 internal::None, internal::None, internal::None, internal::None,
4563 internal::None, internal::None, internal::None, internal::None> {
4564 typedef internal::Types3<T1, T2, T3> type;
4565};
4566template <typename T1, typename T2, typename T3, typename T4>
4567struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
4568 internal::None, internal::None, internal::None, internal::None,
4569 internal::None, internal::None, internal::None, internal::None,
4570 internal::None, internal::None, internal::None, internal::None,
4571 internal::None, internal::None, internal::None, internal::None,
4572 internal::None, internal::None, internal::None, internal::None,
4573 internal::None, internal::None, internal::None, internal::None,
4574 internal::None, internal::None, internal::None, internal::None,
4575 internal::None, internal::None, internal::None, internal::None,
4576 internal::None, internal::None, internal::None, internal::None,
4577 internal::None, internal::None, internal::None, internal::None,
4578 internal::None, internal::None, internal::None> {
4579 typedef internal::Types4<T1, T2, T3, T4> type;
4580};
4581template <typename T1, typename T2, typename T3, typename T4, typename T5>
4582struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
4583 internal::None, internal::None, internal::None, internal::None,
4584 internal::None, internal::None, internal::None, internal::None,
4585 internal::None, internal::None, internal::None, internal::None,
4586 internal::None, internal::None, internal::None, internal::None,
4587 internal::None, internal::None, internal::None, internal::None,
4588 internal::None, internal::None, internal::None, internal::None,
4589 internal::None, internal::None, internal::None, internal::None,
4590 internal::None, internal::None, internal::None, internal::None,
4591 internal::None, internal::None, internal::None, internal::None,
4592 internal::None, internal::None, internal::None, internal::None,
4593 internal::None, internal::None, internal::None> {
4594 typedef internal::Types5<T1, T2, T3, T4, T5> type;
4595};
4596template <typename T1, typename T2, typename T3, typename T4, typename T5,
4597 typename T6>
4598struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
4599 internal::None, internal::None, internal::None, internal::None,
4600 internal::None, internal::None, internal::None, internal::None,
4601 internal::None, internal::None, internal::None, internal::None,
4602 internal::None, internal::None, internal::None, internal::None,
4603 internal::None, internal::None, internal::None, internal::None,
4604 internal::None, internal::None, internal::None, internal::None,
4605 internal::None, internal::None, internal::None, internal::None,
4606 internal::None, internal::None, internal::None, internal::None,
4607 internal::None, internal::None, internal::None, internal::None,
4608 internal::None, internal::None, internal::None, internal::None,
4609 internal::None, internal::None> {
4610 typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
4611};
4612template <typename T1, typename T2, typename T3, typename T4, typename T5,
4613 typename T6, typename T7>
4614struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
4615 internal::None, internal::None, internal::None, internal::None,
4616 internal::None, internal::None, internal::None, internal::None,
4617 internal::None, internal::None, internal::None, internal::None,
4618 internal::None, internal::None, internal::None, internal::None,
4619 internal::None, internal::None, internal::None, internal::None,
4620 internal::None, internal::None, internal::None, internal::None,
4621 internal::None, internal::None, internal::None, internal::None,
4622 internal::None, internal::None, internal::None, internal::None,
4623 internal::None, internal::None, internal::None, internal::None,
4624 internal::None, internal::None, internal::None, internal::None,
4625 internal::None> {
4626 typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
4627};
4628template <typename T1, typename T2, typename T3, typename T4, typename T5,
4629 typename T6, typename T7, typename T8>
4630struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
4631 internal::None, internal::None, internal::None, internal::None,
4632 internal::None, internal::None, internal::None, internal::None,
4633 internal::None, internal::None, internal::None, internal::None,
4634 internal::None, internal::None, internal::None, internal::None,
4635 internal::None, internal::None, internal::None, internal::None,
4636 internal::None, internal::None, internal::None, internal::None,
4637 internal::None, internal::None, internal::None, internal::None,
4638 internal::None, internal::None, internal::None, internal::None,
4639 internal::None, internal::None, internal::None, internal::None,
4640 internal::None, internal::None, internal::None, internal::None> {
4641 typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
4642};
4643template <typename T1, typename T2, typename T3, typename T4, typename T5,
4644 typename T6, typename T7, typename T8, typename T9>
4645struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
4646 internal::None, internal::None, internal::None, internal::None,
4647 internal::None, internal::None, internal::None, internal::None,
4648 internal::None, internal::None, internal::None, internal::None,
4649 internal::None, internal::None, internal::None, internal::None,
4650 internal::None, internal::None, internal::None, internal::None,
4651 internal::None, internal::None, internal::None, internal::None,
4652 internal::None, internal::None, internal::None, internal::None,
4653 internal::None, internal::None, internal::None, internal::None,
4654 internal::None, internal::None, internal::None, internal::None,
4655 internal::None, internal::None, internal::None, internal::None> {
4656 typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
4657};
4658template <typename T1, typename T2, typename T3, typename T4, typename T5,
4659 typename T6, typename T7, typename T8, typename T9, typename T10>
4660struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
4661 internal::None, internal::None, internal::None, internal::None,
4662 internal::None, internal::None, internal::None, internal::None,
4663 internal::None, internal::None, internal::None, internal::None,
4664 internal::None, internal::None, internal::None, internal::None,
4665 internal::None, internal::None, internal::None, internal::None,
4666 internal::None, internal::None, internal::None, internal::None,
4667 internal::None, internal::None, internal::None, internal::None,
4668 internal::None, internal::None, internal::None, internal::None,
4669 internal::None, internal::None, internal::None, internal::None,
4670 internal::None, internal::None, internal::None> {
4671 typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
4672};
4673template <typename T1, typename T2, typename T3, typename T4, typename T5,
4674 typename T6, typename T7, typename T8, typename T9, typename T10,
4675 typename T11>
4676struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
4677 internal::None, internal::None, internal::None, internal::None,
4678 internal::None, internal::None, internal::None, internal::None,
4679 internal::None, internal::None, internal::None, internal::None,
4680 internal::None, internal::None, internal::None, internal::None,
4681 internal::None, internal::None, internal::None, internal::None,
4682 internal::None, internal::None, internal::None, internal::None,
4683 internal::None, internal::None, internal::None, internal::None,
4684 internal::None, internal::None, internal::None, internal::None,
4685 internal::None, internal::None, internal::None, internal::None,
4686 internal::None, internal::None> {
4687 typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
4688};
4689template <typename T1, typename T2, typename T3, typename T4, typename T5,
4690 typename T6, typename T7, typename T8, typename T9, typename T10,
4691 typename T11, typename T12>
4692struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
4693 internal::None, internal::None, internal::None, internal::None,
4694 internal::None, internal::None, internal::None, internal::None,
4695 internal::None, internal::None, internal::None, internal::None,
4696 internal::None, internal::None, internal::None, internal::None,
4697 internal::None, internal::None, internal::None, internal::None,
4698 internal::None, internal::None, internal::None, internal::None,
4699 internal::None, internal::None, internal::None, internal::None,
4700 internal::None, internal::None, internal::None, internal::None,
4701 internal::None, internal::None, internal::None, internal::None,
4702 internal::None> {
4703 typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
4704 T12> type;
4705};
4706template <typename T1, typename T2, typename T3, typename T4, typename T5,
4707 typename T6, typename T7, typename T8, typename T9, typename T10,
4708 typename T11, typename T12, typename T13>
4709struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
4710 internal::None, internal::None, internal::None, internal::None,
4711 internal::None, internal::None, internal::None, internal::None,
4712 internal::None, internal::None, internal::None, internal::None,
4713 internal::None, internal::None, internal::None, internal::None,
4714 internal::None, internal::None, internal::None, internal::None,
4715 internal::None, internal::None, internal::None, internal::None,
4716 internal::None, internal::None, internal::None, internal::None,
4717 internal::None, internal::None, internal::None, internal::None,
4718 internal::None, internal::None, internal::None, internal::None,
4719 internal::None> {
4720 typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4721 T13> type;
4722};
4723template <typename T1, typename T2, typename T3, typename T4, typename T5,
4724 typename T6, typename T7, typename T8, typename T9, typename T10,
4725 typename T11, typename T12, typename T13, typename T14>
4726struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4727 internal::None, internal::None, internal::None, internal::None,
4728 internal::None, internal::None, internal::None, internal::None,
4729 internal::None, internal::None, internal::None, internal::None,
4730 internal::None, internal::None, internal::None, internal::None,
4731 internal::None, internal::None, internal::None, internal::None,
4732 internal::None, internal::None, internal::None, internal::None,
4733 internal::None, internal::None, internal::None, internal::None,
4734 internal::None, internal::None, internal::None, internal::None,
4735 internal::None, internal::None, internal::None, internal::None> {
4736 typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4737 T13, T14> type;
4738};
4739template <typename T1, typename T2, typename T3, typename T4, typename T5,
4740 typename T6, typename T7, typename T8, typename T9, typename T10,
4741 typename T11, typename T12, typename T13, typename T14, typename T15>
4742struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4743 internal::None, internal::None, internal::None, internal::None,
4744 internal::None, internal::None, internal::None, internal::None,
4745 internal::None, internal::None, internal::None, internal::None,
4746 internal::None, internal::None, internal::None, internal::None,
4747 internal::None, internal::None, internal::None, internal::None,
4748 internal::None, internal::None, internal::None, internal::None,
4749 internal::None, internal::None, internal::None, internal::None,
4750 internal::None, internal::None, internal::None, internal::None,
4751 internal::None, internal::None, internal::None> {
4752 typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4753 T13, T14, T15> type;
4754};
4755template <typename T1, typename T2, typename T3, typename T4, typename T5,
4756 typename T6, typename T7, typename T8, typename T9, typename T10,
4757 typename T11, typename T12, typename T13, typename T14, typename T15,
4758 typename T16>
4759struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4760 T16, internal::None, internal::None, internal::None, internal::None,
4761 internal::None, internal::None, internal::None, internal::None,
4762 internal::None, internal::None, internal::None, internal::None,
4763 internal::None, internal::None, internal::None, internal::None,
4764 internal::None, internal::None, internal::None, internal::None,
4765 internal::None, internal::None, internal::None, internal::None,
4766 internal::None, internal::None, internal::None, internal::None,
4767 internal::None, internal::None, internal::None, internal::None,
4768 internal::None, internal::None> {
4769 typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4770 T13, T14, T15, T16> type;
4771};
4772template <typename T1, typename T2, typename T3, typename T4, typename T5,
4773 typename T6, typename T7, typename T8, typename T9, typename T10,
4774 typename T11, typename T12, typename T13, typename T14, typename T15,
4775 typename T16, typename T17>
4776struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4777 T16, T17, internal::None, internal::None, internal::None, internal::None,
4778 internal::None, internal::None, internal::None, internal::None,
4779 internal::None, internal::None, internal::None, internal::None,
4780 internal::None, internal::None, internal::None, internal::None,
4781 internal::None, internal::None, internal::None, internal::None,
4782 internal::None, internal::None, internal::None, internal::None,
4783 internal::None, internal::None, internal::None, internal::None,
4784 internal::None, internal::None, internal::None, internal::None,
4785 internal::None> {
4786 typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4787 T13, T14, T15, T16, T17> type;
4788};
4789template <typename T1, typename T2, typename T3, typename T4, typename T5,
4790 typename T6, typename T7, typename T8, typename T9, typename T10,
4791 typename T11, typename T12, typename T13, typename T14, typename T15,
4792 typename T16, typename T17, typename T18>
4793struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4794 T16, T17, T18, internal::None, internal::None, internal::None,
4795 internal::None, internal::None, internal::None, internal::None,
4796 internal::None, internal::None, internal::None, internal::None,
4797 internal::None, internal::None, internal::None, internal::None,
4798 internal::None, internal::None, internal::None, internal::None,
4799 internal::None, internal::None, internal::None, internal::None,
4800 internal::None, internal::None, internal::None, internal::None,
4801 internal::None, internal::None, internal::None, internal::None,
4802 internal::None> {
4803 typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4804 T13, T14, T15, T16, T17, T18> type;
4805};
4806template <typename T1, typename T2, typename T3, typename T4, typename T5,
4807 typename T6, typename T7, typename T8, typename T9, typename T10,
4808 typename T11, typename T12, typename T13, typename T14, typename T15,
4809 typename T16, typename T17, typename T18, typename T19>
4810struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4811 T16, T17, T18, T19, internal::None, internal::None, internal::None,
4812 internal::None, internal::None, internal::None, internal::None,
4813 internal::None, internal::None, internal::None, internal::None,
4814 internal::None, internal::None, internal::None, internal::None,
4815 internal::None, internal::None, internal::None, internal::None,
4816 internal::None, internal::None, internal::None, internal::None,
4817 internal::None, internal::None, internal::None, internal::None,
4818 internal::None, internal::None, internal::None, internal::None> {
4819 typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4820 T13, T14, T15, T16, T17, T18, T19> type;
4821};
4822template <typename T1, typename T2, typename T3, typename T4, typename T5,
4823 typename T6, typename T7, typename T8, typename T9, typename T10,
4824 typename T11, typename T12, typename T13, typename T14, typename T15,
4825 typename T16, typename T17, typename T18, typename T19, typename T20>
4826struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4827 T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
4828 internal::None, internal::None, internal::None, internal::None,
4829 internal::None, internal::None, internal::None, internal::None,
4830 internal::None, internal::None, internal::None, internal::None,
4831 internal::None, internal::None, internal::None, internal::None,
4832 internal::None, internal::None, internal::None, internal::None,
4833 internal::None, internal::None, internal::None, internal::None,
4834 internal::None, internal::None, internal::None> {
4835 typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4836 T13, T14, T15, T16, T17, T18, T19, T20> type;
4837};
4838template <typename T1, typename T2, typename T3, typename T4, typename T5,
4839 typename T6, typename T7, typename T8, typename T9, typename T10,
4840 typename T11, typename T12, typename T13, typename T14, typename T15,
4841 typename T16, typename T17, typename T18, typename T19, typename T20,
4842 typename T21>
4843struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4844 T16, T17, T18, T19, T20, T21, internal::None, internal::None,
4845 internal::None, internal::None, internal::None, internal::None,
4846 internal::None, internal::None, internal::None, internal::None,
4847 internal::None, internal::None, internal::None, internal::None,
4848 internal::None, internal::None, internal::None, internal::None,
4849 internal::None, internal::None, internal::None, internal::None,
4850 internal::None, internal::None, internal::None, internal::None,
4851 internal::None, internal::None, internal::None> {
4852 typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4853 T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
4854};
4855template <typename T1, typename T2, typename T3, typename T4, typename T5,
4856 typename T6, typename T7, typename T8, typename T9, typename T10,
4857 typename T11, typename T12, typename T13, typename T14, typename T15,
4858 typename T16, typename T17, typename T18, typename T19, typename T20,
4859 typename T21, typename T22>
4860struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4861 T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
4862 internal::None, internal::None, internal::None, internal::None,
4863 internal::None, internal::None, internal::None, internal::None,
4864 internal::None, internal::None, internal::None, internal::None,
4865 internal::None, internal::None, internal::None, internal::None,
4866 internal::None, internal::None, internal::None, internal::None,
4867 internal::None, internal::None, internal::None, internal::None,
4868 internal::None, internal::None> {
4869 typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4870 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
4871};
4872template <typename T1, typename T2, typename T3, typename T4, typename T5,
4873 typename T6, typename T7, typename T8, typename T9, typename T10,
4874 typename T11, typename T12, typename T13, typename T14, typename T15,
4875 typename T16, typename T17, typename T18, typename T19, typename T20,
4876 typename T21, typename T22, typename T23>
4877struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4878 T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
4879 internal::None, internal::None, internal::None, internal::None,
4880 internal::None, internal::None, internal::None, internal::None,
4881 internal::None, internal::None, internal::None, internal::None,
4882 internal::None, internal::None, internal::None, internal::None,
4883 internal::None, internal::None, internal::None, internal::None,
4884 internal::None, internal::None, internal::None, internal::None,
4885 internal::None> {
4886 typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4887 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
4888};
4889template <typename T1, typename T2, typename T3, typename T4, typename T5,
4890 typename T6, typename T7, typename T8, typename T9, typename T10,
4891 typename T11, typename T12, typename T13, typename T14, typename T15,
4892 typename T16, typename T17, typename T18, typename T19, typename T20,
4893 typename T21, typename T22, typename T23, typename T24>
4894struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4895 T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
4896 internal::None, internal::None, internal::None, internal::None,
4897 internal::None, internal::None, internal::None, internal::None,
4898 internal::None, internal::None, internal::None, internal::None,
4899 internal::None, internal::None, internal::None, internal::None,
4900 internal::None, internal::None, internal::None, internal::None,
4901 internal::None, internal::None, internal::None, internal::None,
4902 internal::None> {
4903 typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4904 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
4905};
4906template <typename T1, typename T2, typename T3, typename T4, typename T5,
4907 typename T6, typename T7, typename T8, typename T9, typename T10,
4908 typename T11, typename T12, typename T13, typename T14, typename T15,
4909 typename T16, typename T17, typename T18, typename T19, typename T20,
4910 typename T21, typename T22, typename T23, typename T24, typename T25>
4911struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4912 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
4913 internal::None, internal::None, internal::None, internal::None,
4914 internal::None, internal::None, internal::None, internal::None,
4915 internal::None, internal::None, internal::None, internal::None,
4916 internal::None, internal::None, internal::None, internal::None,
4917 internal::None, internal::None, internal::None, internal::None,
4918 internal::None, internal::None, internal::None, internal::None> {
4919 typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4920 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
4921};
4922template <typename T1, typename T2, typename T3, typename T4, typename T5,
4923 typename T6, typename T7, typename T8, typename T9, typename T10,
4924 typename T11, typename T12, typename T13, typename T14, typename T15,
4925 typename T16, typename T17, typename T18, typename T19, typename T20,
4926 typename T21, typename T22, typename T23, typename T24, typename T25,
4927 typename T26>
4928struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4929 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
4930 internal::None, internal::None, internal::None, internal::None,
4931 internal::None, internal::None, internal::None, internal::None,
4932 internal::None, internal::None, internal::None, internal::None,
4933 internal::None, internal::None, internal::None, internal::None,
4934 internal::None, internal::None, internal::None, internal::None,
4935 internal::None, internal::None, internal::None> {
4936 typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4937 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
4938 T26> type;
4939};
4940template <typename T1, typename T2, typename T3, typename T4, typename T5,
4941 typename T6, typename T7, typename T8, typename T9, typename T10,
4942 typename T11, typename T12, typename T13, typename T14, typename T15,
4943 typename T16, typename T17, typename T18, typename T19, typename T20,
4944 typename T21, typename T22, typename T23, typename T24, typename T25,
4945 typename T26, typename T27>
4946struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4947 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
4948 internal::None, internal::None, internal::None, internal::None,
4949 internal::None, internal::None, internal::None, internal::None,
4950 internal::None, internal::None, internal::None, internal::None,
4951 internal::None, internal::None, internal::None, internal::None,
4952 internal::None, internal::None, internal::None, internal::None,
4953 internal::None, internal::None> {
4954 typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4955 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4956 T27> type;
4957};
4958template <typename T1, typename T2, typename T3, typename T4, typename T5,
4959 typename T6, typename T7, typename T8, typename T9, typename T10,
4960 typename T11, typename T12, typename T13, typename T14, typename T15,
4961 typename T16, typename T17, typename T18, typename T19, typename T20,
4962 typename T21, typename T22, typename T23, typename T24, typename T25,
4963 typename T26, typename T27, typename T28>
4964struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4965 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
4966 internal::None, internal::None, internal::None, internal::None,
4967 internal::None, internal::None, internal::None, internal::None,
4968 internal::None, internal::None, internal::None, internal::None,
4969 internal::None, internal::None, internal::None, internal::None,
4970 internal::None, internal::None, internal::None, internal::None,
4971 internal::None, internal::None> {
4972 typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4973 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4974 T27, T28> type;
4975};
4976template <typename T1, typename T2, typename T3, typename T4, typename T5,
4977 typename T6, typename T7, typename T8, typename T9, typename T10,
4978 typename T11, typename T12, typename T13, typename T14, typename T15,
4979 typename T16, typename T17, typename T18, typename T19, typename T20,
4980 typename T21, typename T22, typename T23, typename T24, typename T25,
4981 typename T26, typename T27, typename T28, typename T29>
4982struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4983 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4984 internal::None, internal::None, internal::None, internal::None,
4985 internal::None, internal::None, internal::None, internal::None,
4986 internal::None, internal::None, internal::None, internal::None,
4987 internal::None, internal::None, internal::None, internal::None,
4988 internal::None, internal::None, internal::None, internal::None,
4989 internal::None> {
4990 typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4991 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4992 T27, T28, T29> type;
4993};
4994template <typename T1, typename T2, typename T3, typename T4, typename T5,
4995 typename T6, typename T7, typename T8, typename T9, typename T10,
4996 typename T11, typename T12, typename T13, typename T14, typename T15,
4997 typename T16, typename T17, typename T18, typename T19, typename T20,
4998 typename T21, typename T22, typename T23, typename T24, typename T25,
4999 typename T26, typename T27, typename T28, typename T29, typename T30>
5000struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5001 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5002 internal::None, internal::None, internal::None, internal::None,
5003 internal::None, internal::None, internal::None, internal::None,
5004 internal::None, internal::None, internal::None, internal::None,
5005 internal::None, internal::None, internal::None, internal::None,
5006 internal::None, internal::None, internal::None, internal::None> {
5007 typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5008 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5009 T27, T28, T29, T30> type;
5010};
5011template <typename T1, typename T2, typename T3, typename T4, typename T5,
5012 typename T6, typename T7, typename T8, typename T9, typename T10,
5013 typename T11, typename T12, typename T13, typename T14, typename T15,
5014 typename T16, typename T17, typename T18, typename T19, typename T20,
5015 typename T21, typename T22, typename T23, typename T24, typename T25,
5016 typename T26, typename T27, typename T28, typename T29, typename T30,
5017 typename T31>
5018struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5019 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5020 T31, internal::None, internal::None, internal::None, internal::None,
5021 internal::None, internal::None, internal::None, internal::None,
5022 internal::None, internal::None, internal::None, internal::None,
5023 internal::None, internal::None, internal::None, internal::None,
5024 internal::None, internal::None, internal::None> {
5025 typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5026 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5027 T27, T28, T29, T30, T31> type;
5028};
5029template <typename T1, typename T2, typename T3, typename T4, typename T5,
5030 typename T6, typename T7, typename T8, typename T9, typename T10,
5031 typename T11, typename T12, typename T13, typename T14, typename T15,
5032 typename T16, typename T17, typename T18, typename T19, typename T20,
5033 typename T21, typename T22, typename T23, typename T24, typename T25,
5034 typename T26, typename T27, typename T28, typename T29, typename T30,
5035 typename T31, typename T32>
5036struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5037 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5038 T31, T32, internal::None, internal::None, internal::None, internal::None,
5039 internal::None, internal::None, internal::None, internal::None,
5040 internal::None, internal::None, internal::None, internal::None,
5041 internal::None, internal::None, internal::None, internal::None,
5042 internal::None, internal::None> {
5043 typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5044 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5045 T27, T28, T29, T30, T31, T32> type;
5046};
5047template <typename T1, typename T2, typename T3, typename T4, typename T5,
5048 typename T6, typename T7, typename T8, typename T9, typename T10,
5049 typename T11, typename T12, typename T13, typename T14, typename T15,
5050 typename T16, typename T17, typename T18, typename T19, typename T20,
5051 typename T21, typename T22, typename T23, typename T24, typename T25,
5052 typename T26, typename T27, typename T28, typename T29, typename T30,
5053 typename T31, typename T32, typename T33>
5054struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5055 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5056 T31, T32, T33, internal::None, internal::None, internal::None,
5057 internal::None, internal::None, internal::None, internal::None,
5058 internal::None, internal::None, internal::None, internal::None,
5059 internal::None, internal::None, internal::None, internal::None,
5060 internal::None, internal::None> {
5061 typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5062 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5063 T27, T28, T29, T30, T31, T32, T33> type;
5064};
5065template <typename T1, typename T2, typename T3, typename T4, typename T5,
5066 typename T6, typename T7, typename T8, typename T9, typename T10,
5067 typename T11, typename T12, typename T13, typename T14, typename T15,
5068 typename T16, typename T17, typename T18, typename T19, typename T20,
5069 typename T21, typename T22, typename T23, typename T24, typename T25,
5070 typename T26, typename T27, typename T28, typename T29, typename T30,
5071 typename T31, typename T32, typename T33, typename T34>
5072struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5073 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5074 T31, T32, T33, T34, internal::None, internal::None, internal::None,
5075 internal::None, internal::None, internal::None, internal::None,
5076 internal::None, internal::None, internal::None, internal::None,
5077 internal::None, internal::None, internal::None, internal::None,
5078 internal::None> {
5079 typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5080 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5081 T27, T28, T29, T30, T31, T32, T33, T34> type;
5082};
5083template <typename T1, typename T2, typename T3, typename T4, typename T5,
5084 typename T6, typename T7, typename T8, typename T9, typename T10,
5085 typename T11, typename T12, typename T13, typename T14, typename T15,
5086 typename T16, typename T17, typename T18, typename T19, typename T20,
5087 typename T21, typename T22, typename T23, typename T24, typename T25,
5088 typename T26, typename T27, typename T28, typename T29, typename T30,
5089 typename T31, typename T32, typename T33, typename T34, typename T35>
5090struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5091 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5092 T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
5093 internal::None, internal::None, internal::None, internal::None,
5094 internal::None, internal::None, internal::None, internal::None,
5095 internal::None, internal::None, internal::None, internal::None> {
5096 typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5097 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5098 T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
5099};
5100template <typename T1, typename T2, typename T3, typename T4, typename T5,
5101 typename T6, typename T7, typename T8, typename T9, typename T10,
5102 typename T11, typename T12, typename T13, typename T14, typename T15,
5103 typename T16, typename T17, typename T18, typename T19, typename T20,
5104 typename T21, typename T22, typename T23, typename T24, typename T25,
5105 typename T26, typename T27, typename T28, typename T29, typename T30,
5106 typename T31, typename T32, typename T33, typename T34, typename T35,
5107 typename T36>
5108struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5109 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5110 T31, T32, T33, T34, T35, T36, internal::None, internal::None,
5111 internal::None, internal::None, internal::None, internal::None,
5112 internal::None, internal::None, internal::None, internal::None,
5113 internal::None, internal::None, internal::None, internal::None> {
5114 typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5115 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5116 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
5117};
5118template <typename T1, typename T2, typename T3, typename T4, typename T5,
5119 typename T6, typename T7, typename T8, typename T9, typename T10,
5120 typename T11, typename T12, typename T13, typename T14, typename T15,
5121 typename T16, typename T17, typename T18, typename T19, typename T20,
5122 typename T21, typename T22, typename T23, typename T24, typename T25,
5123 typename T26, typename T27, typename T28, typename T29, typename T30,
5124 typename T31, typename T32, typename T33, typename T34, typename T35,
5125 typename T36, typename T37>
5126struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5127 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5128 T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
5129 internal::None, internal::None, internal::None, internal::None,
5130 internal::None, internal::None, internal::None, internal::None,
5131 internal::None, internal::None, internal::None> {
5132 typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5133 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5134 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
5135};
5136template <typename T1, typename T2, typename T3, typename T4, typename T5,
5137 typename T6, typename T7, typename T8, typename T9, typename T10,
5138 typename T11, typename T12, typename T13, typename T14, typename T15,
5139 typename T16, typename T17, typename T18, typename T19, typename T20,
5140 typename T21, typename T22, typename T23, typename T24, typename T25,
5141 typename T26, typename T27, typename T28, typename T29, typename T30,
5142 typename T31, typename T32, typename T33, typename T34, typename T35,
5143 typename T36, typename T37, typename T38>
5144struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5145 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5146 T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
5147 internal::None, internal::None, internal::None, internal::None,
5148 internal::None, internal::None, internal::None, internal::None,
5149 internal::None, internal::None> {
5150 typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5151 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5152 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
5153};
5154template <typename T1, typename T2, typename T3, typename T4, typename T5,
5155 typename T6, typename T7, typename T8, typename T9, typename T10,
5156 typename T11, typename T12, typename T13, typename T14, typename T15,
5157 typename T16, typename T17, typename T18, typename T19, typename T20,
5158 typename T21, typename T22, typename T23, typename T24, typename T25,
5159 typename T26, typename T27, typename T28, typename T29, typename T30,
5160 typename T31, typename T32, typename T33, typename T34, typename T35,
5161 typename T36, typename T37, typename T38, typename T39>
5162struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5163 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5164 T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
5165 internal::None, internal::None, internal::None, internal::None,
5166 internal::None, internal::None, internal::None, internal::None,
5167 internal::None, internal::None> {
5168 typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5169 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5170 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
5171};
5172template <typename T1, typename T2, typename T3, typename T4, typename T5,
5173 typename T6, typename T7, typename T8, typename T9, typename T10,
5174 typename T11, typename T12, typename T13, typename T14, typename T15,
5175 typename T16, typename T17, typename T18, typename T19, typename T20,
5176 typename T21, typename T22, typename T23, typename T24, typename T25,
5177 typename T26, typename T27, typename T28, typename T29, typename T30,
5178 typename T31, typename T32, typename T33, typename T34, typename T35,
5179 typename T36, typename T37, typename T38, typename T39, typename T40>
5180struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5181 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5182 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
5183 internal::None, internal::None, internal::None, internal::None,
5184 internal::None, internal::None, internal::None, internal::None,
5185 internal::None> {
5186 typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5187 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5188 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
5189 T40> type;
5190};
5191template <typename T1, typename T2, typename T3, typename T4, typename T5,
5192 typename T6, typename T7, typename T8, typename T9, typename T10,
5193 typename T11, typename T12, typename T13, typename T14, typename T15,
5194 typename T16, typename T17, typename T18, typename T19, typename T20,
5195 typename T21, typename T22, typename T23, typename T24, typename T25,
5196 typename T26, typename T27, typename T28, typename T29, typename T30,
5197 typename T31, typename T32, typename T33, typename T34, typename T35,
5198 typename T36, typename T37, typename T38, typename T39, typename T40,
5199 typename T41>
5200struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5201 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5202 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
5203 internal::None, internal::None, internal::None, internal::None,
5204 internal::None, internal::None, internal::None, internal::None> {
5205 typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5206 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5207 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5208 T41> type;
5209};
5210template <typename T1, typename T2, typename T3, typename T4, typename T5,
5211 typename T6, typename T7, typename T8, typename T9, typename T10,
5212 typename T11, typename T12, typename T13, typename T14, typename T15,
5213 typename T16, typename T17, typename T18, typename T19, typename T20,
5214 typename T21, typename T22, typename T23, typename T24, typename T25,
5215 typename T26, typename T27, typename T28, typename T29, typename T30,
5216 typename T31, typename T32, typename T33, typename T34, typename T35,
5217 typename T36, typename T37, typename T38, typename T39, typename T40,
5218 typename T41, typename T42>
5219struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5220 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5221 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
5222 internal::None, internal::None, internal::None, internal::None,
5223 internal::None, internal::None, internal::None> {
5224 typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5225 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5226 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5227 T41, T42> type;
5228};
5229template <typename T1, typename T2, typename T3, typename T4, typename T5,
5230 typename T6, typename T7, typename T8, typename T9, typename T10,
5231 typename T11, typename T12, typename T13, typename T14, typename T15,
5232 typename T16, typename T17, typename T18, typename T19, typename T20,
5233 typename T21, typename T22, typename T23, typename T24, typename T25,
5234 typename T26, typename T27, typename T28, typename T29, typename T30,
5235 typename T31, typename T32, typename T33, typename T34, typename T35,
5236 typename T36, typename T37, typename T38, typename T39, typename T40,
5237 typename T41, typename T42, typename T43>
5238struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5239 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5240 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5241 internal::None, internal::None, internal::None, internal::None,
5242 internal::None, internal::None, internal::None> {
5243 typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5244 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5245 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5246 T41, T42, T43> type;
5247};
5248template <typename T1, typename T2, typename T3, typename T4, typename T5,
5249 typename T6, typename T7, typename T8, typename T9, typename T10,
5250 typename T11, typename T12, typename T13, typename T14, typename T15,
5251 typename T16, typename T17, typename T18, typename T19, typename T20,
5252 typename T21, typename T22, typename T23, typename T24, typename T25,
5253 typename T26, typename T27, typename T28, typename T29, typename T30,
5254 typename T31, typename T32, typename T33, typename T34, typename T35,
5255 typename T36, typename T37, typename T38, typename T39, typename T40,
5256 typename T41, typename T42, typename T43, typename T44>
5257struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5258 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5259 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
5260 internal::None, internal::None, internal::None, internal::None,
5261 internal::None, internal::None> {
5262 typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5263 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5264 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5265 T41, T42, T43, T44> type;
5266};
5267template <typename T1, typename T2, typename T3, typename T4, typename T5,
5268 typename T6, typename T7, typename T8, typename T9, typename T10,
5269 typename T11, typename T12, typename T13, typename T14, typename T15,
5270 typename T16, typename T17, typename T18, typename T19, typename T20,
5271 typename T21, typename T22, typename T23, typename T24, typename T25,
5272 typename T26, typename T27, typename T28, typename T29, typename T30,
5273 typename T31, typename T32, typename T33, typename T34, typename T35,
5274 typename T36, typename T37, typename T38, typename T39, typename T40,
5275 typename T41, typename T42, typename T43, typename T44, typename T45>
5276struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5277 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5278 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5279 internal::None, internal::None, internal::None, internal::None,
5280 internal::None> {
5281 typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5282 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5283 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5284 T41, T42, T43, T44, T45> type;
5285};
5286template <typename T1, typename T2, typename T3, typename T4, typename T5,
5287 typename T6, typename T7, typename T8, typename T9, typename T10,
5288 typename T11, typename T12, typename T13, typename T14, typename T15,
5289 typename T16, typename T17, typename T18, typename T19, typename T20,
5290 typename T21, typename T22, typename T23, typename T24, typename T25,
5291 typename T26, typename T27, typename T28, typename T29, typename T30,
5292 typename T31, typename T32, typename T33, typename T34, typename T35,
5293 typename T36, typename T37, typename T38, typename T39, typename T40,
5294 typename T41, typename T42, typename T43, typename T44, typename T45,
5295 typename T46>
5296struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5297 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5298 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5299 T46, internal::None, internal::None, internal::None, internal::None> {
5300 typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5301 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5302 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5303 T41, T42, T43, T44, T45, T46> type;
5304};
5305template <typename T1, typename T2, typename T3, typename T4, typename T5,
5306 typename T6, typename T7, typename T8, typename T9, typename T10,
5307 typename T11, typename T12, typename T13, typename T14, typename T15,
5308 typename T16, typename T17, typename T18, typename T19, typename T20,
5309 typename T21, typename T22, typename T23, typename T24, typename T25,
5310 typename T26, typename T27, typename T28, typename T29, typename T30,
5311 typename T31, typename T32, typename T33, typename T34, typename T35,
5312 typename T36, typename T37, typename T38, typename T39, typename T40,
5313 typename T41, typename T42, typename T43, typename T44, typename T45,
5314 typename T46, typename T47>
5315struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5316 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5317 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5318 T46, T47, internal::None, internal::None, internal::None> {
5319 typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5320 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5321 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5322 T41, T42, T43, T44, T45, T46, T47> type;
5323};
5324template <typename T1, typename T2, typename T3, typename T4, typename T5,
5325 typename T6, typename T7, typename T8, typename T9, typename T10,
5326 typename T11, typename T12, typename T13, typename T14, typename T15,
5327 typename T16, typename T17, typename T18, typename T19, typename T20,
5328 typename T21, typename T22, typename T23, typename T24, typename T25,
5329 typename T26, typename T27, typename T28, typename T29, typename T30,
5330 typename T31, typename T32, typename T33, typename T34, typename T35,
5331 typename T36, typename T37, typename T38, typename T39, typename T40,
5332 typename T41, typename T42, typename T43, typename T44, typename T45,
5333 typename T46, typename T47, typename T48>
5334struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5335 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5336 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5337 T46, T47, T48, internal::None, internal::None> {
5338 typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5339 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5340 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5341 T41, T42, T43, T44, T45, T46, T47, T48> type;
5342};
5343template <typename T1, typename T2, typename T3, typename T4, typename T5,
5344 typename T6, typename T7, typename T8, typename T9, typename T10,
5345 typename T11, typename T12, typename T13, typename T14, typename T15,
5346 typename T16, typename T17, typename T18, typename T19, typename T20,
5347 typename T21, typename T22, typename T23, typename T24, typename T25,
5348 typename T26, typename T27, typename T28, typename T29, typename T30,
5349 typename T31, typename T32, typename T33, typename T34, typename T35,
5350 typename T36, typename T37, typename T38, typename T39, typename T40,
5351 typename T41, typename T42, typename T43, typename T44, typename T45,
5352 typename T46, typename T47, typename T48, typename T49>
5353struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5354 T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5355 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5356 T46, T47, T48, T49, internal::None> {
5357 typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5358 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5359 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5360 T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
5361};
5362
5363namespace internal {
5364
5365# define GTEST_TEMPLATE_ template <typename T> class
5366
5367// The template "selector" struct TemplateSel<Tmpl> is used to
5368// represent Tmpl, which must be a class template with one type
5369// parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
5370// as the type Tmpl<T>. This allows us to actually instantiate the
5371// template "selected" by TemplateSel<Tmpl>.
5372//
5373// This trick is necessary for simulating typedef for class templates,
5374// which C++ doesn't support directly.
5375template <GTEST_TEMPLATE_ Tmpl>
5376struct TemplateSel {
5377 template <typename T>
5378 struct Bind {
5379 typedef Tmpl<T> type;
5380 };
5381};
5382
5383# define GTEST_BIND_(TmplSel, T) \
5384 TmplSel::template Bind<T>::type
5385
5386// A unique struct template used as the default value for the
5387// arguments of class template Templates. This allows us to simulate
5388// variadic templates (e.g. Templates<int>, Templates<int, double>,
5389// and etc), which C++ doesn't support directly.
5390template <typename T>
5391struct NoneT {};
5392
5393// The following family of struct and struct templates are used to
5394// represent template lists. In particular, TemplatesN<T1, T2, ...,
5395// TN> represents a list of N templates (T1, T2, ..., and TN). Except
5396// for Templates0, every struct in the family has two member types:
5397// Head for the selector of the first template in the list, and Tail
5398// for the rest of the list.
5399
5400// The empty template list.
5401struct Templates0 {};
5402
5403// Template lists of length 1, 2, 3, and so on.
5404
5405template <GTEST_TEMPLATE_ T1>
5406struct Templates1 {
5407 typedef TemplateSel<T1> Head;
5408 typedef Templates0 Tail;
5409};
5410template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
5411struct Templates2 {
5412 typedef TemplateSel<T1> Head;
5413 typedef Templates1<T2> Tail;
5414};
5415
5416template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
5417struct Templates3 {
5418 typedef TemplateSel<T1> Head;
5419 typedef Templates2<T2, T3> Tail;
5420};
5421
5422template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5423 GTEST_TEMPLATE_ T4>
5424struct Templates4 {
5425 typedef TemplateSel<T1> Head;
5426 typedef Templates3<T2, T3, T4> Tail;
5427};
5428
5429template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5430 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
5431struct Templates5 {
5432 typedef TemplateSel<T1> Head;
5433 typedef Templates4<T2, T3, T4, T5> Tail;
5434};
5435
5436template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5437 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
5438struct Templates6 {
5439 typedef TemplateSel<T1> Head;
5440 typedef Templates5<T2, T3, T4, T5, T6> Tail;
5441};
5442
5443template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5444 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5445 GTEST_TEMPLATE_ T7>
5446struct Templates7 {
5447 typedef TemplateSel<T1> Head;
5448 typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
5449};
5450
5451template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5452 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5453 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
5454struct Templates8 {
5455 typedef TemplateSel<T1> Head;
5456 typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
5457};
5458
5459template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5460 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5461 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
5462struct Templates9 {
5463 typedef TemplateSel<T1> Head;
5464 typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
5465};
5466
5467template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5468 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5469 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5470 GTEST_TEMPLATE_ T10>
5471struct Templates10 {
5472 typedef TemplateSel<T1> Head;
5473 typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
5474};
5475
5476template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5477 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5478 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5479 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
5480struct Templates11 {
5481 typedef TemplateSel<T1> Head;
5482 typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
5483};
5484
5485template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5486 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5487 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5488 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
5489struct Templates12 {
5490 typedef TemplateSel<T1> Head;
5491 typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
5492};
5493
5494template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5495 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5496 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5497 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5498 GTEST_TEMPLATE_ T13>
5499struct Templates13 {
5500 typedef TemplateSel<T1> Head;
5501 typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
5502};
5503
5504template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5505 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5506 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5507 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5508 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
5509struct Templates14 {
5510 typedef TemplateSel<T1> Head;
5511 typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5512 T14> Tail;
5513};
5514
5515template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5516 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5517 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5518 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5519 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
5520struct Templates15 {
5521 typedef TemplateSel<T1> Head;
5522 typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5523 T15> Tail;
5524};
5525
5526template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5527 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5528 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5529 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5530 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5531 GTEST_TEMPLATE_ T16>
5532struct Templates16 {
5533 typedef TemplateSel<T1> Head;
5534 typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5535 T15, T16> Tail;
5536};
5537
5538template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5539 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5540 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5541 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5542 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5543 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
5544struct Templates17 {
5545 typedef TemplateSel<T1> Head;
5546 typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5547 T15, T16, T17> Tail;
5548};
5549
5550template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5551 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5552 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5553 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5554 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5555 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
5556struct Templates18 {
5557 typedef TemplateSel<T1> Head;
5558 typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5559 T15, T16, T17, T18> Tail;
5560};
5561
5562template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5563 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5564 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5565 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5566 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5567 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5568 GTEST_TEMPLATE_ T19>
5569struct Templates19 {
5570 typedef TemplateSel<T1> Head;
5571 typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5572 T15, T16, T17, T18, T19> Tail;
5573};
5574
5575template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5576 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5577 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5578 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5579 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5580 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5581 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
5582struct Templates20 {
5583 typedef TemplateSel<T1> Head;
5584 typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5585 T15, T16, T17, T18, T19, T20> Tail;
5586};
5587
5588template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5589 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5590 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5591 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5592 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5593 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5594 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
5595struct Templates21 {
5596 typedef TemplateSel<T1> Head;
5597 typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5598 T15, T16, T17, T18, T19, T20, T21> Tail;
5599};
5600
5601template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5602 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5603 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5604 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5605 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5606 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5607 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5608 GTEST_TEMPLATE_ T22>
5609struct Templates22 {
5610 typedef TemplateSel<T1> Head;
5611 typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5612 T15, T16, T17, T18, T19, T20, T21, T22> Tail;
5613};
5614
5615template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5616 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5617 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5618 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5619 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5620 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5621 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5622 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
5623struct Templates23 {
5624 typedef TemplateSel<T1> Head;
5625 typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5626 T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
5627};
5628
5629template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5630 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5631 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5632 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5633 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5634 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5635 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5636 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
5637struct Templates24 {
5638 typedef TemplateSel<T1> Head;
5639 typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5640 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
5641};
5642
5643template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5644 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5645 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5646 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5647 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5648 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5649 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5650 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5651 GTEST_TEMPLATE_ T25>
5652struct Templates25 {
5653 typedef TemplateSel<T1> Head;
5654 typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5655 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
5656};
5657
5658template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5659 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5660 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5661 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5662 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5663 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5664 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5665 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5666 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
5667struct Templates26 {
5668 typedef TemplateSel<T1> Head;
5669 typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5670 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
5671};
5672
5673template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5674 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5675 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5676 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5677 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5678 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5679 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5680 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5681 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
5682struct Templates27 {
5683 typedef TemplateSel<T1> Head;
5684 typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5685 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
5686};
5687
5688template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5689 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5690 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5691 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5692 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5693 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5694 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5695 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5696 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5697 GTEST_TEMPLATE_ T28>
5698struct Templates28 {
5699 typedef TemplateSel<T1> Head;
5700 typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5701 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5702 T28> Tail;
5703};
5704
5705template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5706 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5707 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5708 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5709 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5710 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5711 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5712 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5713 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5714 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
5715struct Templates29 {
5716 typedef TemplateSel<T1> Head;
5717 typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5718 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5719 T29> Tail;
5720};
5721
5722template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5723 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5724 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5725 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5726 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5727 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5728 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5729 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5730 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5731 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
5732struct Templates30 {
5733 typedef TemplateSel<T1> Head;
5734 typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5735 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5736 T29, T30> Tail;
5737};
5738
5739template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5740 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5741 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5742 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5743 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5744 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5745 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5746 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5747 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5748 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5749 GTEST_TEMPLATE_ T31>
5750struct Templates31 {
5751 typedef TemplateSel<T1> Head;
5752 typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5753 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5754 T29, T30, T31> Tail;
5755};
5756
5757template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5758 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5759 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5760 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5761 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5762 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5763 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5764 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5765 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5766 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5767 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
5768struct Templates32 {
5769 typedef TemplateSel<T1> Head;
5770 typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5771 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5772 T29, T30, T31, T32> Tail;
5773};
5774
5775template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5776 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5777 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5778 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5779 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5780 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5781 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5782 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5783 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5784 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5785 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
5786struct Templates33 {
5787 typedef TemplateSel<T1> Head;
5788 typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5789 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5790 T29, T30, T31, T32, T33> Tail;
5791};
5792
5793template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5794 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5795 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5796 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5797 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5798 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5799 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5800 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5801 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5802 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5803 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5804 GTEST_TEMPLATE_ T34>
5805struct Templates34 {
5806 typedef TemplateSel<T1> Head;
5807 typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5808 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5809 T29, T30, T31, T32, T33, T34> Tail;
5810};
5811
5812template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5813 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5814 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5815 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5816 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5817 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5818 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5819 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5820 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5821 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5822 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5823 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
5824struct Templates35 {
5825 typedef TemplateSel<T1> Head;
5826 typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5827 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5828 T29, T30, T31, T32, T33, T34, T35> Tail;
5829};
5830
5831template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5832 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5833 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5834 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5835 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5836 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5837 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5838 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5839 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5840 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5841 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5842 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
5843struct Templates36 {
5844 typedef TemplateSel<T1> Head;
5845 typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5846 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5847 T29, T30, T31, T32, T33, T34, T35, T36> Tail;
5848};
5849
5850template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5851 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5852 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5853 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5854 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5855 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5856 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5857 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5858 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5859 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5860 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5861 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5862 GTEST_TEMPLATE_ T37>
5863struct Templates37 {
5864 typedef TemplateSel<T1> Head;
5865 typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5866 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5867 T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
5868};
5869
5870template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5871 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5872 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5873 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5874 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5875 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5876 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5877 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5878 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5879 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5880 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5881 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5882 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
5883struct Templates38 {
5884 typedef TemplateSel<T1> Head;
5885 typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5886 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5887 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
5888};
5889
5890template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5891 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5892 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5893 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5894 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5895 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5896 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5897 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5898 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5899 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5900 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5901 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5902 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
5903struct Templates39 {
5904 typedef TemplateSel<T1> Head;
5905 typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5906 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5907 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
5908};
5909
5910template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5911 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5912 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5913 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5914 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5915 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5916 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5917 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5918 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5919 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5920 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5921 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5922 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5923 GTEST_TEMPLATE_ T40>
5924struct Templates40 {
5925 typedef TemplateSel<T1> Head;
5926 typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5927 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5928 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
5929};
5930
5931template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5932 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5933 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5934 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5935 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5936 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5937 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5938 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5939 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5940 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5941 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5942 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5943 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5944 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
5945struct Templates41 {
5946 typedef TemplateSel<T1> Head;
5947 typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5948 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5949 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
5950};
5951
5952template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5953 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5954 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5955 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5956 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5957 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5958 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5959 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5960 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5961 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5962 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5963 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5964 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5965 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
5966struct Templates42 {
5967 typedef TemplateSel<T1> Head;
5968 typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5969 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5970 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
5971 T42> Tail;
5972};
5973
5974template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5975 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5976 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5977 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5978 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5979 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5980 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5981 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5982 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5983 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5984 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5985 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5986 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5987 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5988 GTEST_TEMPLATE_ T43>
5989struct Templates43 {
5990 typedef TemplateSel<T1> Head;
5991 typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5992 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5993 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5994 T43> Tail;
5995};
5996
5997template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5998 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5999 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6000 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6001 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6002 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6003 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6004 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6005 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6006 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6007 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6008 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6009 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6010 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6011 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6012struct Templates44 {
6013 typedef TemplateSel<T1> Head;
6014 typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6015 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6016 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6017 T43, T44> Tail;
6018};
6019
6020template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6021 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6022 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6023 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6024 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6025 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6026 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6027 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6028 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6029 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6030 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6031 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6032 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6033 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6034 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6035struct Templates45 {
6036 typedef TemplateSel<T1> Head;
6037 typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6038 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6039 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6040 T43, T44, T45> Tail;
6041};
6042
6043template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6044 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6045 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6046 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6047 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6048 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6049 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6050 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6051 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6052 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6053 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6054 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6055 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6056 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6057 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6058 GTEST_TEMPLATE_ T46>
6059struct Templates46 {
6060 typedef TemplateSel<T1> Head;
6061 typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6062 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6063 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6064 T43, T44, T45, T46> Tail;
6065};
6066
6067template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6068 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6069 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6070 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6071 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6072 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6073 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6074 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6075 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6076 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6077 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6078 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6079 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6080 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6081 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6082 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6083struct Templates47 {
6084 typedef TemplateSel<T1> Head;
6085 typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6086 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6087 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6088 T43, T44, T45, T46, T47> Tail;
6089};
6090
6091template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6092 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6093 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6094 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6095 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6096 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6097 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6098 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6099 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6100 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6101 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6102 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6103 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6104 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6105 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6106 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6107struct Templates48 {
6108 typedef TemplateSel<T1> Head;
6109 typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6110 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6111 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6112 T43, T44, T45, T46, T47, T48> Tail;
6113};
6114
6115template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6116 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6117 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6118 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6119 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6120 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6121 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6122 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6123 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6124 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6125 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6126 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6127 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6128 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6129 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6130 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6131 GTEST_TEMPLATE_ T49>
6132struct Templates49 {
6133 typedef TemplateSel<T1> Head;
6134 typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6135 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6136 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6137 T43, T44, T45, T46, T47, T48, T49> Tail;
6138};
6139
6140template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6141 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6142 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6143 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6144 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6145 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6146 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6147 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6148 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6149 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6150 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6151 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6152 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6153 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6154 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6155 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6156 GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
6157struct Templates50 {
6158 typedef TemplateSel<T1> Head;
6159 typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6160 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6161 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6162 T43, T44, T45, T46, T47, T48, T49, T50> Tail;
6163};
6164
6165
6166// We don't want to require the users to write TemplatesN<...> directly,
6167// as that would require them to count the length. Templates<...> is much
6168// easier to write, but generates horrible messages when there is a
6169// compiler error, as gcc insists on printing out each template
6170// argument, even if it has the default value (this means Templates<list>
6171// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
6172// errors).
6173//
6174// Our solution is to combine the best part of the two approaches: a
6175// user would write Templates<T1, ..., TN>, and Google Test will translate
6176// that to TemplatesN<T1, ..., TN> internally to make error messages
6177// readable. The translation is done by the 'type' member of the
6178// Templates template.
6179template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
6180 GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
6181 GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
6182 GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
6183 GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
6184 GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
6185 GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
6186 GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
6187 GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
6188 GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
6189 GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
6190 GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
6191 GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
6192 GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
6193 GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
6194 GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
6195 GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
6196 GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
6197 GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
6198 GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
6199 GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
6200 GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
6201 GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
6202 GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
6203 GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
6204struct Templates {
6205 typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6206 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6207 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6208 T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
6209};
6210
6211template <>
6212struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6213 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6214 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6215 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6216 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6217 NoneT> {
6218 typedef Templates0 type;
6219};
6220template <GTEST_TEMPLATE_ T1>
6221struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6222 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6223 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6224 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6225 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6226 NoneT> {
6227 typedef Templates1<T1> type;
6228};
6229template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
6230struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6231 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6232 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6233 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6234 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6235 NoneT> {
6236 typedef Templates2<T1, T2> type;
6237};
6238template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
6239struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6240 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6241 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6242 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6243 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6244 typedef Templates3<T1, T2, T3> type;
6245};
6246template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6247 GTEST_TEMPLATE_ T4>
6248struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6249 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6250 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6251 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6252 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6253 typedef Templates4<T1, T2, T3, T4> type;
6254};
6255template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6256 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
6257struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6258 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6259 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6260 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6261 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6262 typedef Templates5<T1, T2, T3, T4, T5> type;
6263};
6264template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6265 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
6266struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
6267 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6268 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6269 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6270 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6271 typedef Templates6<T1, T2, T3, T4, T5, T6> type;
6272};
6273template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6274 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6275 GTEST_TEMPLATE_ T7>
6276struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
6277 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6278 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6279 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6280 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6281 typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
6282};
6283template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6284 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6285 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
6286struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
6287 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6288 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6289 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6290 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6291 typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
6292};
6293template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6294 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6295 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
6296struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
6297 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6298 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6299 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6300 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6301 typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
6302};
6303template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6304 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6305 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6306 GTEST_TEMPLATE_ T10>
6307struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
6308 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6309 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6310 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6311 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6312 typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
6313};
6314template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6315 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6316 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6317 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
6318struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
6319 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6320 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6321 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6322 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6323 typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
6324};
6325template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6326 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6327 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6328 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
6329struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
6330 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6331 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6332 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6333 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6334 typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
6335};
6336template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6337 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6338 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6339 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6340 GTEST_TEMPLATE_ T13>
6341struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
6342 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6343 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6344 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6345 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6346 typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6347 T13> type;
6348};
6349template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6350 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6351 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6352 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6353 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
6354struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6355 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6356 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6357 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6358 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6359 typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6360 T14> type;
6361};
6362template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6363 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6364 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6365 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6366 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
6367struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6368 T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6369 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6370 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6371 NoneT, NoneT, NoneT, NoneT, NoneT> {
6372 typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6373 T14, T15> type;
6374};
6375template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6376 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6377 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6378 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6379 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6380 GTEST_TEMPLATE_ T16>
6381struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6382 T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6383 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6384 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6385 NoneT, NoneT, NoneT, NoneT, NoneT> {
6386 typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6387 T14, T15, T16> type;
6388};
6389template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6390 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6391 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6392 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6393 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6394 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
6395struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6396 T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6397 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6398 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6399 NoneT, NoneT, NoneT, NoneT, NoneT> {
6400 typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6401 T14, T15, T16, T17> type;
6402};
6403template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6404 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6405 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6406 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6407 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6408 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
6409struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6410 T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6411 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6412 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6413 NoneT, NoneT, NoneT, NoneT> {
6414 typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6415 T14, T15, T16, T17, T18> type;
6416};
6417template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6418 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6419 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6420 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6421 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6422 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6423 GTEST_TEMPLATE_ T19>
6424struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6425 T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6426 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6427 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6428 NoneT, NoneT, NoneT, NoneT> {
6429 typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6430 T14, T15, T16, T17, T18, T19> type;
6431};
6432template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6433 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6434 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6435 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6436 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6437 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6438 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
6439struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6440 T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6441 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6442 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6443 NoneT, NoneT, NoneT, NoneT> {
6444 typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6445 T14, T15, T16, T17, T18, T19, T20> type;
6446};
6447template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6448 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6449 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6450 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6451 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6452 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6453 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
6454struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6455 T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
6456 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6457 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6458 NoneT, NoneT, NoneT, NoneT> {
6459 typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6460 T14, T15, T16, T17, T18, T19, T20, T21> type;
6461};
6462template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6463 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6464 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6465 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6466 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6467 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6468 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6469 GTEST_TEMPLATE_ T22>
6470struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6471 T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
6472 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6473 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6474 NoneT, NoneT, NoneT> {
6475 typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6476 T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
6477};
6478template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6479 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6480 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6481 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6482 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6483 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6484 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6485 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
6486struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6487 T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
6488 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6489 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6490 NoneT, NoneT, NoneT> {
6491 typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6492 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
6493};
6494template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6495 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6496 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6497 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6498 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6499 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6500 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6501 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
6502struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6503 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
6504 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6505 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6506 NoneT, NoneT, NoneT> {
6507 typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6508 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
6509};
6510template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6511 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6512 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6513 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6514 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6515 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6516 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6517 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6518 GTEST_TEMPLATE_ T25>
6519struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6520 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
6521 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6522 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6523 NoneT, NoneT> {
6524 typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6525 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
6526};
6527template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6528 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6529 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6530 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6531 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6532 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6533 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6534 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6535 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
6536struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6537 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
6538 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6539 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6540 NoneT, NoneT> {
6541 typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6542 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
6543};
6544template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6545 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6546 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6547 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6548 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6549 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6550 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6551 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6552 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
6553struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6554 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
6555 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6556 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6557 NoneT, NoneT> {
6558 typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6559 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6560 T27> type;
6561};
6562template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6563 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6564 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6565 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6566 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6567 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6568 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6569 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6570 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6571 GTEST_TEMPLATE_ T28>
6572struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6573 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6574 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6575 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6576 NoneT, NoneT> {
6577 typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6578 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6579 T28> type;
6580};
6581template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6582 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6583 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6584 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6585 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6586 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6587 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6588 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6589 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6590 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
6591struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6592 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6593 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6594 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6595 NoneT> {
6596 typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6597 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6598 T28, T29> type;
6599};
6600template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6601 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6602 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6603 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6604 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6605 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6606 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6607 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6608 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6609 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
6610struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6611 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6612 T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6613 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6614 typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6615 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6616 T28, T29, T30> type;
6617};
6618template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6619 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6620 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6621 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6622 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6623 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6624 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6625 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6626 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6627 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6628 GTEST_TEMPLATE_ T31>
6629struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6630 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6631 T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6632 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6633 typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6634 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6635 T28, T29, T30, T31> type;
6636};
6637template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6638 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6639 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6640 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6641 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6642 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6643 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6644 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6645 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6646 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6647 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
6648struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6649 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6650 T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6651 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6652 typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6653 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6654 T28, T29, T30, T31, T32> type;
6655};
6656template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6657 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6658 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6659 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6660 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6661 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6662 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6663 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6664 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6665 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6666 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
6667struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6668 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6669 T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6670 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6671 typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6672 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6673 T28, T29, T30, T31, T32, T33> type;
6674};
6675template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6676 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6677 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6678 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6679 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6680 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6681 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6682 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6683 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6684 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6685 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6686 GTEST_TEMPLATE_ T34>
6687struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6688 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6689 T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6690 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6691 typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6692 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6693 T28, T29, T30, T31, T32, T33, T34> type;
6694};
6695template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6696 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6697 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6698 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6699 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6700 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6701 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6702 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6703 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6704 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6705 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6706 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
6707struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6708 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6709 T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6710 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6711 typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6712 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6713 T28, T29, T30, T31, T32, T33, T34, T35> type;
6714};
6715template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6716 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6717 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6718 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6719 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6720 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6721 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6722 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6723 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6724 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6725 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6726 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
6727struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6728 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6729 T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
6730 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6731 typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6732 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6733 T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
6734};
6735template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6736 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6737 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6738 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6739 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6740 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6741 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6742 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6743 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6744 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6745 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6746 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6747 GTEST_TEMPLATE_ T37>
6748struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6749 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6750 T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
6751 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6752 typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6753 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6754 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
6755};
6756template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6757 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6758 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6759 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6760 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6761 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6762 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6763 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6764 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6765 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6766 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6767 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6768 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
6769struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6770 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6771 T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
6772 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6773 typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6774 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6775 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
6776};
6777template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6778 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6779 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6780 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6781 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6782 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6783 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6784 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6785 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6786 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6787 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6788 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6789 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
6790struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6791 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6792 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
6793 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6794 typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6795 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6796 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
6797};
6798template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6799 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6800 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6801 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6802 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6803 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6804 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6805 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6806 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6807 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6808 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6809 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6810 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6811 GTEST_TEMPLATE_ T40>
6812struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6813 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6814 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
6815 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6816 typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6817 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6818 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
6819};
6820template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6821 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6822 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6823 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6824 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6825 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6826 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6827 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6828 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6829 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6830 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6831 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6832 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6833 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
6834struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6835 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6836 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
6837 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6838 typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6839 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6840 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6841 T41> type;
6842};
6843template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6844 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6845 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6846 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6847 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6848 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6849 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6850 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6851 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6852 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6853 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6854 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6855 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6856 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
6857struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6858 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6859 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
6860 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6861 typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6862 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6863 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6864 T42> type;
6865};
6866template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6867 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6868 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6869 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6870 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6871 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6872 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6873 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6874 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6875 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6876 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6877 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6878 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6879 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6880 GTEST_TEMPLATE_ T43>
6881struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6882 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6883 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6884 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6885 typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6886 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6887 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6888 T42, T43> type;
6889};
6890template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6891 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6892 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6893 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6894 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6895 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6896 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6897 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6898 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6899 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6900 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6901 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6902 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6903 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6904 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6905struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6906 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6907 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6908 NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6909 typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6910 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6911 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6912 T42, T43, T44> type;
6913};
6914template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6915 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6916 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6917 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6918 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6919 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6920 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6921 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6922 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6923 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6924 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6925 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6926 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6927 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6928 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6929struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6930 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6931 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6932 T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
6933 typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6934 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6935 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6936 T42, T43, T44, T45> type;
6937};
6938template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6939 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6940 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6941 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6942 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6943 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6944 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6945 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6946 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6947 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6948 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6949 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6950 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6951 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6952 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6953 GTEST_TEMPLATE_ T46>
6954struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6955 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6956 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6957 T45, T46, NoneT, NoneT, NoneT, NoneT> {
6958 typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6959 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6960 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6961 T42, T43, T44, T45, T46> type;
6962};
6963template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6964 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6965 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6966 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6967 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6968 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6969 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6970 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6971 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6972 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6973 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6974 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6975 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6976 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6977 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6978 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6979struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6980 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6981 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6982 T45, T46, T47, NoneT, NoneT, NoneT> {
6983 typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6984 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6985 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6986 T42, T43, T44, T45, T46, T47> type;
6987};
6988template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6989 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6990 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6991 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6992 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6993 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6994 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6995 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6996 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6997 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6998 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6999 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7000 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7001 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7002 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7003 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
7004struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7005 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7006 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7007 T45, T46, T47, T48, NoneT, NoneT> {
7008 typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7009 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7010 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7011 T42, T43, T44, T45, T46, T47, T48> type;
7012};
7013template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
7014 GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
7015 GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
7016 GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
7017 GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
7018 GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
7019 GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
7020 GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
7021 GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
7022 GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
7023 GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
7024 GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
7025 GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
7026 GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
7027 GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
7028 GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
7029 GTEST_TEMPLATE_ T49>
7030struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
7031 T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
7032 T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
7033 T45, T46, T47, T48, T49, NoneT> {
7034 typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7035 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
7036 T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
7037 T42, T43, T44, T45, T46, T47, T48, T49> type;
7038};
7039
7040// The TypeList template makes it possible to use either a single type
7041// or a Types<...> list in TYPED_TEST_CASE() and
7042// INSTANTIATE_TYPED_TEST_CASE_P().
7043
7044template <typename T>
7045struct TypeList {
7046 typedef Types1<T> type;
7047};
7048
7049template <typename T1, typename T2, typename T3, typename T4, typename T5,
7050 typename T6, typename T7, typename T8, typename T9, typename T10,
7051 typename T11, typename T12, typename T13, typename T14, typename T15,
7052 typename T16, typename T17, typename T18, typename T19, typename T20,
7053 typename T21, typename T22, typename T23, typename T24, typename T25,
7054 typename T26, typename T27, typename T28, typename T29, typename T30,
7055 typename T31, typename T32, typename T33, typename T34, typename T35,
7056 typename T36, typename T37, typename T38, typename T39, typename T40,
7057 typename T41, typename T42, typename T43, typename T44, typename T45,
7058 typename T46, typename T47, typename T48, typename T49, typename T50>
7059struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7060 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7061 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
7062 T44, T45, T46, T47, T48, T49, T50> > {
7063 typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
7064 T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
7065 T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
7066 T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
7067};
7068
7069#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7070
7071} // namespace internal
7072} // namespace testing
7073
7074#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
7075
7076// Due to C++ preprocessor weirdness, we need double indirection to
7077// concatenate two tokens when one of them is __LINE__. Writing
7078//
7079// foo ## __LINE__
7080//
7081// will result in the token foo__LINE__, instead of foo followed by
7082// the current line number. For more details, see
7083// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
7084#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
7085#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
7086
7087class ProtocolMessage;
7088namespace proto2 { class Message; }
7089
7090namespace testing {
7091
7092// Forward declarations.
7093
7094class AssertionResult; // Result of an assertion.
7095class Message; // Represents a failure message.
7096class Test; // Represents a test.
7097class TestInfo; // Information about a test.
7098class TestPartResult; // Result of a test part.
7099class UnitTest; // A collection of test cases.
7100
7101template <typename T>
7102::std::string PrintToString(const T& value);
7103
7104namespace internal {
7105
7106struct TraceInfo; // Information about a trace point.
7107class ScopedTrace; // Implements scoped trace.
7108class TestInfoImpl; // Opaque implementation of TestInfo
7109class UnitTestImpl; // Opaque implementation of UnitTest
7110
7111// How many times InitGoogleTest() has been called.
7112GTEST_API_ extern int g_init_gtest_count;
7113
7114// The text used in failure messages to indicate the start of the
7115// stack trace.
7116GTEST_API_ extern const char kStackTraceMarker[];
7117
7118// Two overloaded helpers for checking at compile time whether an
7119// expression is a null pointer literal (i.e. NULL or any 0-valued
7120// compile-time integral constant). Their return values have
7121// different sizes, so we can use sizeof() to test which version is
7122// picked by the compiler. These helpers have no implementations, as
7123// we only need their signatures.
7124//
7125// Given IsNullLiteralHelper(x), the compiler will pick the first
7126// version if x can be implicitly converted to Secret*, and pick the
7127// second version otherwise. Since Secret is a secret and incomplete
7128// type, the only expression a user can write that has type Secret* is
7129// a null pointer literal. Therefore, we know that x is a null
7130// pointer literal if and only if the first version is picked by the
7131// compiler.
7132char IsNullLiteralHelper(Secret* p);
7133char (&IsNullLiteralHelper(...))[2]; // NOLINT
7134
7135// A compile-time bool constant that is true if and only if x is a
7136// null pointer literal (i.e. NULL or any 0-valued compile-time
7137// integral constant).
7138#ifdef GTEST_ELLIPSIS_NEEDS_POD_
7139// We lose support for NULL detection where the compiler doesn't like
7140// passing non-POD classes through ellipsis (...).
7141# define GTEST_IS_NULL_LITERAL_(x) false
7142#else
7143# define GTEST_IS_NULL_LITERAL_(x) \
7144 (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
7145#endif // GTEST_ELLIPSIS_NEEDS_POD_
7146
7147// Appends the user-supplied message to the Google-Test-generated message.
7148GTEST_API_ std::string AppendUserMessage(
7149 const std::string& gtest_msg, const Message& user_msg);
7150
7151#if GTEST_HAS_EXCEPTIONS
7152
7153// This exception is thrown by (and only by) a failed Google Test
7154// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
7155// are enabled). We derive it from std::runtime_error, which is for
7156// errors presumably detectable only at run time. Since
7157// std::runtime_error inherits from std::exception, many testing
7158// frameworks know how to extract and print the message inside it.
7159
7160#ifdef _MSC_VER
7161# pragma warning(push) // Saves the current warning state.
7162# pragma warning(disable:4275) // Temporarily disables warning 4275.
7163#endif // _MSC_VER
7164
7165class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
7166 public:
7167 explicit GoogleTestFailureException(const TestPartResult& failure);
7168};
7169
7170#ifdef _MSC_VER
7171# pragma warning(pop) // Restores the warning state.
7172#endif // _MSC_VER
7173
7174#endif // GTEST_HAS_EXCEPTIONS
7175
7176// A helper class for creating scoped traces in user programs.
7177class GTEST_API_ ScopedTrace {
7178 public:
7179 // The c'tor pushes the given source file location and message onto
7180 // a trace stack maintained by Google Test.
7181 ScopedTrace(const char* file, int line, const Message& message);
7182
7183 // The d'tor pops the info pushed by the c'tor.
7184 //
7185 // Note that the d'tor is not virtual in order to be efficient.
7186 // Don't inherit from ScopedTrace!
7187 ~ScopedTrace();
7188
7189 private:
7190 GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
7191} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
7192 // c'tor and d'tor. Therefore it doesn't
7193 // need to be used otherwise.
7194
7195// Constructs and returns the message for an equality assertion
7196// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
7197//
7198// The first four parameters are the expressions used in the assertion
7199// and their values, as strings. For example, for ASSERT_EQ(foo, bar)
7200// where foo is 5 and bar is 6, we have:
7201//
7202// expected_expression: "foo"
7203// actual_expression: "bar"
7204// expected_value: "5"
7205// actual_value: "6"
7206//
7207// The ignoring_case parameter is true iff the assertion is a
7208// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
7209// be inserted into the message.
7210GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
7211 const char* actual_expression,
7212 const std::string& expected_value,
7213 const std::string& actual_value,
7214 bool ignoring_case);
7215
7216// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
7217GTEST_API_ std::string GetBoolAssertionFailureMessage(
7218 const AssertionResult& assertion_result,
7219 const char* expression_text,
7220 const char* actual_predicate_value,
7221 const char* expected_predicate_value);
7222
7223// This template class represents an IEEE floating-point number
7224// (either single-precision or double-precision, depending on the
7225// template parameters).
7226//
7227// The purpose of this class is to do more sophisticated number
7228// comparison. (Due to round-off error, etc, it's very unlikely that
7229// two floating-points will be equal exactly. Hence a naive
7230// comparison by the == operation often doesn't work.)
7231//
7232// Format of IEEE floating-point:
7233//
7234// The most-significant bit being the leftmost, an IEEE
7235// floating-point looks like
7236//
7237// sign_bit exponent_bits fraction_bits
7238//
7239// Here, sign_bit is a single bit that designates the sign of the
7240// number.
7241//
7242// For float, there are 8 exponent bits and 23 fraction bits.
7243//
7244// For double, there are 11 exponent bits and 52 fraction bits.
7245//
7246// More details can be found at
7247// http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
7248//
7249// Template parameter:
7250//
7251// RawType: the raw floating-point type (either float or double)
7252template <typename RawType>
7253class FloatingPoint {
7254 public:
7255 // Defines the unsigned integer type that has the same size as the
7256 // floating point number.
7257 typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
7258
7259 // Constants.
7260
7261 // # of bits in a number.
7262 static const size_t kBitCount = 8*sizeof(RawType);
7263
7264 // # of fraction bits in a number.
7265 static const size_t kFractionBitCount =
7266 std::numeric_limits<RawType>::digits - 1;
7267
7268 // # of exponent bits in a number.
7269 static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
7270
7271 // The mask for the sign bit.
7272 static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
7273
7274 // The mask for the fraction bits.
7275 static const Bits kFractionBitMask =
7276 ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
7277
7278 // The mask for the exponent bits.
7279 static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
7280
7281 // How many ULP's (Units in the Last Place) we want to tolerate when
7282 // comparing two numbers. The larger the value, the more error we
7283 // allow. A 0 value means that two numbers must be exactly the same
7284 // to be considered equal.
7285 //
7286 // The maximum error of a single floating-point operation is 0.5
7287 // units in the last place. On Intel CPU's, all floating-point
7288 // calculations are done with 80-bit precision, while double has 64
7289 // bits. Therefore, 4 should be enough for ordinary use.
7290 //
7291 // See the following article for more details on ULP:
7292 // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
7293 static const size_t kMaxUlps = 4;
7294
7295 // Constructs a FloatingPoint from a raw floating-point number.
7296 //
7297 // On an Intel CPU, passing a non-normalized NAN (Not a Number)
7298 // around may change its bits, although the new value is guaranteed
7299 // to be also a NAN. Therefore, don't expect this constructor to
7300 // preserve the bits in x when x is a NAN.
7301 explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
7302
7303 // Static methods
7304
7305 // Reinterprets a bit pattern as a floating-point number.
7306 //
7307 // This function is needed to test the AlmostEquals() method.
7308 static RawType ReinterpretBits(const Bits bits) {
7309 FloatingPoint fp(0);
7310 fp.u_.bits_ = bits;
7311 return fp.u_.value_;
7312 }
7313
7314 // Returns the floating-point number that represent positive infinity.
7315 static RawType Infinity() {
7316 return ReinterpretBits(kExponentBitMask);
7317 }
7318
7319 // Returns the maximum representable finite floating-point number.
7320 static RawType Max();
7321
7322 // Non-static methods
7323
7324 // Returns the bits that represents this number.
7325 const Bits &bits() const { return u_.bits_; }
7326
7327 // Returns the exponent bits of this number.
7328 Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
7329
7330 // Returns the fraction bits of this number.
7331 Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
7332
7333 // Returns the sign bit of this number.
7334 Bits sign_bit() const { return kSignBitMask & u_.bits_; }
7335
7336 // Returns true iff this is NAN (not a number).
7337 bool is_nan() const {
7338 // It's a NAN if the exponent bits are all ones and the fraction
7339 // bits are not entirely zeros.
7340 return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
7341 }
7342
7343 // Returns true iff this number is at most kMaxUlps ULP's away from
7344 // rhs. In particular, this function:
7345 //
7346 // - returns false if either number is (or both are) NAN.
7347 // - treats really large numbers as almost equal to infinity.
7348 // - thinks +0.0 and -0.0 are 0 DLP's apart.
7349 bool AlmostEquals(const FloatingPoint& rhs) const {
7350 // The IEEE standard says that any comparison operation involving
7351 // a NAN must return false.
7352 if (is_nan() || rhs.is_nan()) return false;
7353
7354 return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
7355 <= kMaxUlps;
7356 }
7357
7358 private:
7359 // The data type used to store the actual floating-point number.
7360 union FloatingPointUnion {
7361 RawType value_; // The raw floating-point number.
7362 Bits bits_; // The bits that represent the number.
7363 };
7364
7365 // Converts an integer from the sign-and-magnitude representation to
7366 // the biased representation. More precisely, let N be 2 to the
7367 // power of (kBitCount - 1), an integer x is represented by the
7368 // unsigned number x + N.
7369 //
7370 // For instance,
7371 //
7372 // -N + 1 (the most negative number representable using
7373 // sign-and-magnitude) is represented by 1;
7374 // 0 is represented by N; and
7375 // N - 1 (the biggest number representable using
7376 // sign-and-magnitude) is represented by 2N - 1.
7377 //
7378 // Read http://en.wikipedia.org/wiki/Signed_number_representations
7379 // for more details on signed number representations.
7380 static Bits SignAndMagnitudeToBiased(const Bits &sam) {
7381 if (kSignBitMask & sam) {
7382 // sam represents a negative number.
7383 return ~sam + 1;
7384 } else {
7385 // sam represents a positive number.
7386 return kSignBitMask | sam;
7387 }
7388 }
7389
7390 // Given two numbers in the sign-and-magnitude representation,
7391 // returns the distance between them as an unsigned number.
7392 static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
7393 const Bits &sam2) {
7394 const Bits biased1 = SignAndMagnitudeToBiased(sam1);
7395 const Bits biased2 = SignAndMagnitudeToBiased(sam2);
7396 return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
7397 }
7398
7399 FloatingPointUnion u_;
7400};
7401
7402// We cannot use std::numeric_limits<T>::max() as it clashes with the max()
7403// macro defined by <windows.h>.
7404template <>
7405inline float FloatingPoint<float>::Max() { return FLT_MAX; }
7406template <>
7407inline double FloatingPoint<double>::Max() { return DBL_MAX; }
7408
7409// Typedefs the instances of the FloatingPoint template class that we
7410// care to use.
7411typedef FloatingPoint<float> Float;
7412typedef FloatingPoint<double> Double;
7413
7414// In order to catch the mistake of putting tests that use different
7415// test fixture classes in the same test case, we need to assign
7416// unique IDs to fixture classes and compare them. The TypeId type is
7417// used to hold such IDs. The user should treat TypeId as an opaque
7418// type: the only operation allowed on TypeId values is to compare
7419// them for equality using the == operator.
7420typedef const void* TypeId;
7421
7422template <typename T>
7423class TypeIdHelper {
7424 public:
7425 // dummy_ must not have a const type. Otherwise an overly eager
7426 // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
7427 // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
7428 static bool dummy_;
7429};
7430
7431template <typename T>
7432bool TypeIdHelper<T>::dummy_ = false;
7433
7434// GetTypeId<T>() returns the ID of type T. Different values will be
7435// returned for different types. Calling the function twice with the
7436// same type argument is guaranteed to return the same ID.
7437template <typename T>
7438TypeId GetTypeId() {
7439 // The compiler is required to allocate a different
7440 // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
7441 // the template. Therefore, the address of dummy_ is guaranteed to
7442 // be unique.
7443 return &(TypeIdHelper<T>::dummy_);
7444}
7445
7446// Returns the type ID of ::testing::Test. Always call this instead
7447// of GetTypeId< ::testing::Test>() to get the type ID of
7448// ::testing::Test, as the latter may give the wrong result due to a
7449// suspected linker bug when compiling Google Test as a Mac OS X
7450// framework.
7451GTEST_API_ TypeId GetTestTypeId();
7452
7453// Defines the abstract factory interface that creates instances
7454// of a Test object.
7455class TestFactoryBase {
7456 public:
7457 virtual ~TestFactoryBase() {}
7458
7459 // Creates a test instance to run. The instance is both created and destroyed
7460 // within TestInfoImpl::Run()
7461 virtual Test* CreateTest() = 0;
7462
7463 protected:
7464 TestFactoryBase() {}
7465
7466 private:
7467 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
7468};
7469
7470// This class provides implementation of TeastFactoryBase interface.
7471// It is used in TEST and TEST_F macros.
7472template <class TestClass>
7473class TestFactoryImpl : public TestFactoryBase {
7474 public:
7475 virtual Test* CreateTest() { return new TestClass; }
7476};
7477
7478#if GTEST_OS_WINDOWS
7479
7480// Predicate-formatters for implementing the HRESULT checking macros
7481// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
7482// We pass a long instead of HRESULT to avoid causing an
7483// include dependency for the HRESULT type.
7484GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
7485 long hr); // NOLINT
7486GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
7487 long hr); // NOLINT
7488
7489#endif // GTEST_OS_WINDOWS
7490
7491// Types of SetUpTestCase() and TearDownTestCase() functions.
7492typedef void (*SetUpTestCaseFunc)();
7493typedef void (*TearDownTestCaseFunc)();
7494
7495// Creates a new TestInfo object and registers it with Google Test;
7496// returns the created object.
7497//
7498// Arguments:
7499//
7500// test_case_name: name of the test case
7501// name: name of the test
7502// type_param the name of the test's type parameter, or NULL if
7503// this is not a typed or a type-parameterized test.
7504// value_param text representation of the test's value parameter,
7505// or NULL if this is not a type-parameterized test.
7506// fixture_class_id: ID of the test fixture class
7507// set_up_tc: pointer to the function that sets up the test case
7508// tear_down_tc: pointer to the function that tears down the test case
7509// factory: pointer to the factory that creates a test object.
7510// The newly created TestInfo instance will assume
7511// ownership of the factory object.
7512GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
7513 const char* test_case_name,
7514 const char* name,
7515 const char* type_param,
7516 const char* value_param,
7517 TypeId fixture_class_id,
7518 SetUpTestCaseFunc set_up_tc,
7519 TearDownTestCaseFunc tear_down_tc,
7520 TestFactoryBase* factory);
7521
7522// If *pstr starts with the given prefix, modifies *pstr to be right
7523// past the prefix and returns true; otherwise leaves *pstr unchanged
7524// and returns false. None of pstr, *pstr, and prefix can be NULL.
7525GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
7526
7527#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7528
7529// State of the definition of a type-parameterized test case.
7530class GTEST_API_ TypedTestCasePState {
7531 public:
7532 TypedTestCasePState() : registered_(false) {}
7533
7534 // Adds the given test name to defined_test_names_ and return true
7535 // if the test case hasn't been registered; otherwise aborts the
7536 // program.
7537 bool AddTestName(const char* file, int line, const char* case_name,
7538 const char* test_name) {
7539 if (registered_) {
7540 fprintf(stderr, "%s Test %s must be defined before "
7541 "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
7542 FormatFileLocation(file, line).c_str(), test_name, case_name);
7543 fflush(stderr);
7544 posix::Abort();
7545 }
7546 defined_test_names_.insert(test_name);
7547 return true;
7548 }
7549
7550 // Verifies that registered_tests match the test names in
7551 // defined_test_names_; returns registered_tests if successful, or
7552 // aborts the program otherwise.
7553 const char* VerifyRegisteredTestNames(
7554 const char* file, int line, const char* registered_tests);
7555
7556 private:
7557 bool registered_;
7558 ::std::set<const char*> defined_test_names_;
7559};
7560
7561// Skips to the first non-space char after the first comma in 'str';
7562// returns NULL if no comma is found in 'str'.
7563inline const char* SkipComma(const char* str) {
7564 const char* comma = strchr(str, ',');
7565 if (comma == NULL) {
7566 return NULL;
7567 }
7568 while (IsSpace(*(++comma))) {}
7569 return comma;
7570}
7571
7572// Returns the prefix of 'str' before the first comma in it; returns
7573// the entire string if it contains no comma.
7574inline std::string GetPrefixUntilComma(const char* str) {
7575 const char* comma = strchr(str, ',');
7576 return comma == NULL ? str : std::string(str, comma);
7577}
7578
7579// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
7580// registers a list of type-parameterized tests with Google Test. The
7581// return value is insignificant - we just need to return something
7582// such that we can call this function in a namespace scope.
7583//
7584// Implementation note: The GTEST_TEMPLATE_ macro declares a template
7585// template parameter. It's defined in gtest-type-util.h.
7586template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
7587class TypeParameterizedTest {
7588 public:
7589 // 'index' is the index of the test in the type list 'Types'
7590 // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
7591 // Types). Valid values for 'index' are [0, N - 1] where N is the
7592 // length of Types.
7593 static bool Register(const char* prefix, const char* case_name,
7594 const char* test_names, int index) {
7595 typedef typename Types::Head Type;
7596 typedef Fixture<Type> FixtureClass;
7597 typedef typename GTEST_BIND_(TestSel, Type) TestClass;
7598
7599 // First, registers the first type-parameterized test in the type
7600 // list.
7601 MakeAndRegisterTestInfo(
7602 (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
7603 + StreamableToString(index)).c_str(),
7604 GetPrefixUntilComma(test_names).c_str(),
7605 GetTypeName<Type>().c_str(),
7606 NULL, // No value parameter.
7607 GetTypeId<FixtureClass>(),
7608 TestClass::SetUpTestCase,
7609 TestClass::TearDownTestCase,
7610 new TestFactoryImpl<TestClass>);
7611
7612 // Next, recurses (at compile time) with the tail of the type list.
7613 return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
7614 ::Register(prefix, case_name, test_names, index + 1);
7615 }
7616};
7617
7618// The base case for the compile time recursion.
7619template <GTEST_TEMPLATE_ Fixture, class TestSel>
7620class TypeParameterizedTest<Fixture, TestSel, Types0> {
7621 public:
7622 static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7623 const char* /*test_names*/, int /*index*/) {
7624 return true;
7625 }
7626};
7627
7628// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
7629// registers *all combinations* of 'Tests' and 'Types' with Google
7630// Test. The return value is insignificant - we just need to return
7631// something such that we can call this function in a namespace scope.
7632template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
7633class TypeParameterizedTestCase {
7634 public:
7635 static bool Register(const char* prefix, const char* case_name,
7636 const char* test_names) {
7637 typedef typename Tests::Head Head;
7638
7639 // First, register the first test in 'Test' for each type in 'Types'.
7640 TypeParameterizedTest<Fixture, Head, Types>::Register(
7641 prefix, case_name, test_names, 0);
7642
7643 // Next, recurses (at compile time) with the tail of the test list.
7644 return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
7645 ::Register(prefix, case_name, SkipComma(test_names));
7646 }
7647};
7648
7649// The base case for the compile time recursion.
7650template <GTEST_TEMPLATE_ Fixture, typename Types>
7651class TypeParameterizedTestCase<Fixture, Templates0, Types> {
7652 public:
7653 static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7654 const char* /*test_names*/) {
7655 return true;
7656 }
7657};
7658
7659#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7660
7661// Returns the current OS stack trace as an std::string.
7662//
7663// The maximum number of stack frames to be included is specified by
7664// the gtest_stack_trace_depth flag. The skip_count parameter
7665// specifies the number of top frames to be skipped, which doesn't
7666// count against the number of frames to be included.
7667//
7668// For example, if Foo() calls Bar(), which in turn calls
7669// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
7670// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
7671GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
7672 UnitTest* unit_test, int skip_count);
7673
7674// Helpers for suppressing warnings on unreachable code or constant
7675// condition.
7676
7677// Always returns true.
7678GTEST_API_ bool AlwaysTrue();
7679
7680// Always returns false.
7681inline bool AlwaysFalse() { return !AlwaysTrue(); }
7682
7683// Helper for suppressing false warning from Clang on a const char*
7684// variable declared in a conditional expression always being NULL in
7685// the else branch.
7686struct GTEST_API_ ConstCharPtr {
7687 ConstCharPtr(const char* str) : value(str) {}
7688 operator bool() const { return true; }
7689 const char* value;
7690};
7691
7692// A simple Linear Congruential Generator for generating random
7693// numbers with a uniform distribution. Unlike rand() and srand(), it
7694// doesn't use global state (and therefore can't interfere with user
7695// code). Unlike rand_r(), it's portable. An LCG isn't very random,
7696// but it's good enough for our purposes.
7697class GTEST_API_ Random {
7698 public:
7699 static const UInt32 kMaxRange = 1u << 31;
7700
7701 explicit Random(UInt32 seed) : state_(seed) {}
7702
7703 void Reseed(UInt32 seed) { state_ = seed; }
7704
7705 // Generates a random number from [0, range). Crashes if 'range' is
7706 // 0 or greater than kMaxRange.
7707 UInt32 Generate(UInt32 range);
7708
7709 private:
7710 UInt32 state_;
7711 GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
7712};
7713
7714// Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
7715// compiler error iff T1 and T2 are different types.
7716template <typename T1, typename T2>
7717struct CompileAssertTypesEqual;
7718
7719template <typename T>
7720struct CompileAssertTypesEqual<T, T> {
7721};
7722
7723// Removes the reference from a type if it is a reference type,
7724// otherwise leaves it unchanged. This is the same as
7725// tr1::remove_reference, which is not widely available yet.
7726template <typename T>
7727struct RemoveReference { typedef T type; }; // NOLINT
7728template <typename T>
7729struct RemoveReference<T&> { typedef T type; }; // NOLINT
7730
7731// A handy wrapper around RemoveReference that works when the argument
7732// T depends on template parameters.
7733#define GTEST_REMOVE_REFERENCE_(T) \
7734 typename ::testing::internal::RemoveReference<T>::type
7735
7736// Removes const from a type if it is a const type, otherwise leaves
7737// it unchanged. This is the same as tr1::remove_const, which is not
7738// widely available yet.
7739template <typename T>
7740struct RemoveConst { typedef T type; }; // NOLINT
7741template <typename T>
7742struct RemoveConst<const T> { typedef T type; }; // NOLINT
7743
7744// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
7745// definition to fail to remove the const in 'const int[3]' and 'const
7746// char[3][4]'. The following specialization works around the bug.
7747template <typename T, size_t N>
7748struct RemoveConst<const T[N]> {
7749 typedef typename RemoveConst<T>::type type[N];
7750};
7751
7752#if defined(_MSC_VER) && _MSC_VER < 1400
7753// This is the only specialization that allows VC++ 7.1 to remove const in
7754// 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC
7755// and thus needs to be conditionally compiled.
7756template <typename T, size_t N>
7757struct RemoveConst<T[N]> {
7758 typedef typename RemoveConst<T>::type type[N];
7759};
7760#endif
7761
7762// A handy wrapper around RemoveConst that works when the argument
7763// T depends on template parameters.
7764#define GTEST_REMOVE_CONST_(T) \
7765 typename ::testing::internal::RemoveConst<T>::type
7766
7767// Turns const U&, U&, const U, and U all into U.
7768#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
7769 GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
7770
7771// Adds reference to a type if it is not a reference type,
7772// otherwise leaves it unchanged. This is the same as
7773// tr1::add_reference, which is not widely available yet.
7774template <typename T>
7775struct AddReference { typedef T& type; }; // NOLINT
7776template <typename T>
7777struct AddReference<T&> { typedef T& type; }; // NOLINT
7778
7779// A handy wrapper around AddReference that works when the argument T
7780// depends on template parameters.
7781#define GTEST_ADD_REFERENCE_(T) \
7782 typename ::testing::internal::AddReference<T>::type
7783
7784// Adds a reference to const on top of T as necessary. For example,
7785// it transforms
7786//
7787// char ==> const char&
7788// const char ==> const char&
7789// char& ==> const char&
7790// const char& ==> const char&
7791//
7792// The argument T must depend on some template parameters.
7793#define GTEST_REFERENCE_TO_CONST_(T) \
7794 GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
7795
7796// ImplicitlyConvertible<From, To>::value is a compile-time bool
7797// constant that's true iff type From can be implicitly converted to
7798// type To.
7799template <typename From, typename To>
7800class ImplicitlyConvertible {
7801 private:
7802 // We need the following helper functions only for their types.
7803 // They have no implementations.
7804
7805 // MakeFrom() is an expression whose type is From. We cannot simply
7806 // use From(), as the type From may not have a public default
7807 // constructor.
7808 static From MakeFrom();
7809
7810 // These two functions are overloaded. Given an expression
7811 // Helper(x), the compiler will pick the first version if x can be
7812 // implicitly converted to type To; otherwise it will pick the
7813 // second version.
7814 //
7815 // The first version returns a value of size 1, and the second
7816 // version returns a value of size 2. Therefore, by checking the
7817 // size of Helper(x), which can be done at compile time, we can tell
7818 // which version of Helper() is used, and hence whether x can be
7819 // implicitly converted to type To.
7820 static char Helper(To);
7821 static char (&Helper(...))[2]; // NOLINT
7822
7823 // We have to put the 'public' section after the 'private' section,
7824 // or MSVC refuses to compile the code.
7825 public:
7826 // MSVC warns about implicitly converting from double to int for
7827 // possible loss of data, so we need to temporarily disable the
7828 // warning.
7829#ifdef _MSC_VER
7830# pragma warning(push) // Saves the current warning state.
7831# pragma warning(disable:4244) // Temporarily disables warning 4244.
7832
7833 static const bool value =
7834 sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7835# pragma warning(pop) // Restores the warning state.
7836#elif defined(__BORLANDC__)
7837 // C++Builder cannot use member overload resolution during template
7838 // instantiation. The simplest workaround is to use its C++0x type traits
7839 // functions (C++Builder 2009 and above only).
7840 static const bool value = __is_convertible(From, To);
7841#else
7842 static const bool value =
7843 sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7844#endif // _MSV_VER
7845};
7846template <typename From, typename To>
7847const bool ImplicitlyConvertible<From, To>::value;
7848
7849// IsAProtocolMessage<T>::value is a compile-time bool constant that's
7850// true iff T is type ProtocolMessage, proto2::Message, or a subclass
7851// of those.
7852template <typename T>
7853struct IsAProtocolMessage
7854 : public bool_constant<
7855 ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
7856 ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
7857};
7858
7859// When the compiler sees expression IsContainerTest<C>(0), if C is an
7860// STL-style container class, the first overload of IsContainerTest
7861// will be viable (since both C::iterator* and C::const_iterator* are
7862// valid types and NULL can be implicitly converted to them). It will
7863// be picked over the second overload as 'int' is a perfect match for
7864// the type of argument 0. If C::iterator or C::const_iterator is not
7865// a valid type, the first overload is not viable, and the second
7866// overload will be picked. Therefore, we can determine whether C is
7867// a container class by checking the type of IsContainerTest<C>(0).
7868// The value of the expression is insignificant.
7869//
7870// Note that we look for both C::iterator and C::const_iterator. The
7871// reason is that C++ injects the name of a class as a member of the
7872// class itself (e.g. you can refer to class iterator as either
7873// 'iterator' or 'iterator::iterator'). If we look for C::iterator
7874// only, for example, we would mistakenly think that a class named
7875// iterator is an STL container.
7876//
7877// Also note that the simpler approach of overloading
7878// IsContainerTest(typename C::const_iterator*) and
7879// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
7880typedef int IsContainer;
7881template <class C>
7882IsContainer IsContainerTest(int /* dummy */,
7883 typename C::iterator* /* it */ = NULL,
7884 typename C::const_iterator* /* const_it */ = NULL) {
7885 return 0;
7886}
7887
7888typedef char IsNotContainer;
7889template <class C>
7890IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
7891
7892// EnableIf<condition>::type is void when 'Cond' is true, and
7893// undefined when 'Cond' is false. To use SFINAE to make a function
7894// overload only apply when a particular expression is true, add
7895// "typename EnableIf<expression>::type* = 0" as the last parameter.
7896template<bool> struct EnableIf;
7897template<> struct EnableIf<true> { typedef void type; }; // NOLINT
7898
7899// Utilities for native arrays.
7900
7901// ArrayEq() compares two k-dimensional native arrays using the
7902// elements' operator==, where k can be any integer >= 0. When k is
7903// 0, ArrayEq() degenerates into comparing a single pair of values.
7904
7905template <typename T, typename U>
7906bool ArrayEq(const T* lhs, size_t size, const U* rhs);
7907
7908// This generic version is used when k is 0.
7909template <typename T, typename U>
7910inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
7911
7912// This overload is used when k >= 1.
7913template <typename T, typename U, size_t N>
7914inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
7915 return internal::ArrayEq(lhs, N, rhs);
7916}
7917
7918// This helper reduces code bloat. If we instead put its logic inside
7919// the previous ArrayEq() function, arrays with different sizes would
7920// lead to different copies of the template code.
7921template <typename T, typename U>
7922bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
7923 for (size_t i = 0; i != size; i++) {
7924 if (!internal::ArrayEq(lhs[i], rhs[i]))
7925 return false;
7926 }
7927 return true;
7928}
7929
7930// Finds the first element in the iterator range [begin, end) that
7931// equals elem. Element may be a native array type itself.
7932template <typename Iter, typename Element>
7933Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
7934 for (Iter it = begin; it != end; ++it) {
7935 if (internal::ArrayEq(*it, elem))
7936 return it;
7937 }
7938 return end;
7939}
7940
7941// CopyArray() copies a k-dimensional native array using the elements'
7942// operator=, where k can be any integer >= 0. When k is 0,
7943// CopyArray() degenerates into copying a single value.
7944
7945template <typename T, typename U>
7946void CopyArray(const T* from, size_t size, U* to);
7947
7948// This generic version is used when k is 0.
7949template <typename T, typename U>
7950inline void CopyArray(const T& from, U* to) { *to = from; }
7951
7952// This overload is used when k >= 1.
7953template <typename T, typename U, size_t N>
7954inline void CopyArray(const T(&from)[N], U(*to)[N]) {
7955 internal::CopyArray(from, N, *to);
7956}
7957
7958// This helper reduces code bloat. If we instead put its logic inside
7959// the previous CopyArray() function, arrays with different sizes
7960// would lead to different copies of the template code.
7961template <typename T, typename U>
7962void CopyArray(const T* from, size_t size, U* to) {
7963 for (size_t i = 0; i != size; i++) {
7964 internal::CopyArray(from[i], to + i);
7965 }
7966}
7967
7968// The relation between an NativeArray object (see below) and the
7969// native array it represents.
7970enum RelationToSource {
7971 kReference, // The NativeArray references the native array.
7972 kCopy // The NativeArray makes a copy of the native array and
7973 // owns the copy.
7974};
7975
7976// Adapts a native array to a read-only STL-style container. Instead
7977// of the complete STL container concept, this adaptor only implements
7978// members useful for Google Mock's container matchers. New members
7979// should be added as needed. To simplify the implementation, we only
7980// support Element being a raw type (i.e. having no top-level const or
7981// reference modifier). It's the client's responsibility to satisfy
7982// this requirement. Element can be an array type itself (hence
7983// multi-dimensional arrays are supported).
7984template <typename Element>
7985class NativeArray {
7986 public:
7987 // STL-style container typedefs.
7988 typedef Element value_type;
7989 typedef Element* iterator;
7990 typedef const Element* const_iterator;
7991
7992 // Constructs from a native array.
7993 NativeArray(const Element* array, size_t count, RelationToSource relation) {
7994 Init(array, count, relation);
7995 }
7996
7997 // Copy constructor.
7998 NativeArray(const NativeArray& rhs) {
7999 Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
8000 }
8001
8002 ~NativeArray() {
8003 // Ensures that the user doesn't instantiate NativeArray with a
8004 // const or reference type.
8005 static_cast<void>(StaticAssertTypeEqHelper<Element,
8006 GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
8007 if (relation_to_source_ == kCopy)
8008 delete[] array_;
8009 }
8010
8011 // STL-style container methods.
8012 size_t size() const { return size_; }
8013 const_iterator begin() const { return array_; }
8014 const_iterator end() const { return array_ + size_; }
8015 bool operator==(const NativeArray& rhs) const {
8016 return size() == rhs.size() &&
8017 ArrayEq(begin(), size(), rhs.begin());
8018 }
8019
8020 private:
8021 // Initializes this object; makes a copy of the input array if
8022 // 'relation' is kCopy.
8023 void Init(const Element* array, size_t a_size, RelationToSource relation) {
8024 if (relation == kReference) {
8025 array_ = array;
8026 } else {
8027 Element* const copy = new Element[a_size];
8028 CopyArray(array, a_size, copy);
8029 array_ = copy;
8030 }
8031 size_ = a_size;
8032 relation_to_source_ = relation;
8033 }
8034
8035 const Element* array_;
8036 size_t size_;
8037 RelationToSource relation_to_source_;
8038
8039 GTEST_DISALLOW_ASSIGN_(NativeArray);
8040};
8041
8042} // namespace internal
8043} // namespace testing
8044
8045#define GTEST_MESSAGE_AT_(file, line, message, result_type) \
8046 ::testing::internal::AssertHelper(result_type, file, line, message) \
8047 = ::testing::Message()
8048
8049#define GTEST_MESSAGE_(message, result_type) \
8050 GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
8051
8052#define GTEST_FATAL_FAILURE_(message) \
8053 return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
8054
8055#define GTEST_NONFATAL_FAILURE_(message) \
8056 GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
8057
8058#define GTEST_SUCCESS_(message) \
8059 GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
8060
8061// Suppresses MSVC warnings 4072 (unreachable code) for the code following
8062// statement if it returns or throws (or doesn't return or throw in some
8063// situations).
8064#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
8065 if (::testing::internal::AlwaysTrue()) { statement; }
8066
8067#define GTEST_TEST_THROW_(statement, expected_exception, fail) \
8068 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8069 if (::testing::internal::ConstCharPtr gtest_msg = "") { \
8070 bool gtest_caught_expected = false; \
8071 try { \
8072 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8073 } \
8074 catch (expected_exception const&) { \
8075 gtest_caught_expected = true; \
8076 } \
8077 catch (...) { \
8078 gtest_msg.value = \
8079 "Expected: " #statement " throws an exception of type " \
8080 #expected_exception ".\n Actual: it throws a different type."; \
8081 goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
8082 } \
8083 if (!gtest_caught_expected) { \
8084 gtest_msg.value = \
8085 "Expected: " #statement " throws an exception of type " \
8086 #expected_exception ".\n Actual: it throws nothing."; \
8087 goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
8088 } \
8089 } else \
8090 GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
8091 fail(gtest_msg.value)
8092
8093#define GTEST_TEST_NO_THROW_(statement, fail) \
8094 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8095 if (::testing::internal::AlwaysTrue()) { \
8096 try { \
8097 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8098 } \
8099 catch (...) { \
8100 goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
8101 } \
8102 } else \
8103 GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
8104 fail("Expected: " #statement " doesn't throw an exception.\n" \
8105 " Actual: it throws.")
8106
8107#define GTEST_TEST_ANY_THROW_(statement, fail) \
8108 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8109 if (::testing::internal::AlwaysTrue()) { \
8110 bool gtest_caught_any = false; \
8111 try { \
8112 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8113 } \
8114 catch (...) { \
8115 gtest_caught_any = true; \
8116 } \
8117 if (!gtest_caught_any) { \
8118 goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
8119 } \
8120 } else \
8121 GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
8122 fail("Expected: " #statement " throws an exception.\n" \
8123 " Actual: it doesn't.")
8124
8125
8126// Implements Boolean test assertions such as EXPECT_TRUE. expression can be
8127// either a boolean expression or an AssertionResult. text is a textual
8128// represenation of expression as it was passed into the EXPECT_TRUE.
8129#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
8130 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8131 if (const ::testing::AssertionResult gtest_ar_ = \
8132 ::testing::AssertionResult(expression)) \
8133 ; \
8134 else \
8135 fail(::testing::internal::GetBoolAssertionFailureMessage(\
8136 gtest_ar_, text, #actual, #expected).c_str())
8137
8138#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
8139 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8140 if (::testing::internal::AlwaysTrue()) { \
8141 ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
8142 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8143 if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
8144 goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
8145 } \
8146 } else \
8147 GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
8148 fail("Expected: " #statement " doesn't generate new fatal " \
8149 "failures in the current thread.\n" \
8150 " Actual: it does.")
8151
8152// Expands to the name of the class that implements the given test.
8153#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
8154 test_case_name##_##test_name##_Test
8155
8156// Helper macro for defining tests.
8157#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
8158class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
8159 public:\
8160 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
8161 private:\
8162 virtual void TestBody();\
8163 static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
8164 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
8165 GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
8166};\
8167\
8168::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
8169 ::test_info_ =\
8170 ::testing::internal::MakeAndRegisterTestInfo(\
8171 #test_case_name, #test_name, NULL, NULL, \
8172 (parent_id), \
8173 parent_class::SetUpTestCase, \
8174 parent_class::TearDownTestCase, \
8175 new ::testing::internal::TestFactoryImpl<\
8176 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
8177void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
8178
8179#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
8180// Copyright 2005, Google Inc.
8181// All rights reserved.
8182//
8183// Redistribution and use in source and binary forms, with or without
8184// modification, are permitted provided that the following conditions are
8185// met:
8186//
8187// * Redistributions of source code must retain the above copyright
8188// notice, this list of conditions and the following disclaimer.
8189// * Redistributions in binary form must reproduce the above
8190// copyright notice, this list of conditions and the following disclaimer
8191// in the documentation and/or other materials provided with the
8192// distribution.
8193// * Neither the name of Google Inc. nor the names of its
8194// contributors may be used to endorse or promote products derived from
8195// this software without specific prior written permission.
8196//
8197// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8198// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8199// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8200// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8201// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8202// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8203// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8204// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8205// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8206// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8207// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8208//
8209// Author: wan@google.com (Zhanyong Wan)
8210//
8211// The Google C++ Testing Framework (Google Test)
8212//
8213// This header file defines the public API for death tests. It is
8214// #included by gtest.h so a user doesn't need to include this
8215// directly.
8216
8217#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8218#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8219
8220// Copyright 2005, Google Inc.
8221// All rights reserved.
8222//
8223// Redistribution and use in source and binary forms, with or without
8224// modification, are permitted provided that the following conditions are
8225// met:
8226//
8227// * Redistributions of source code must retain the above copyright
8228// notice, this list of conditions and the following disclaimer.
8229// * Redistributions in binary form must reproduce the above
8230// copyright notice, this list of conditions and the following disclaimer
8231// in the documentation and/or other materials provided with the
8232// distribution.
8233// * Neither the name of Google Inc. nor the names of its
8234// contributors may be used to endorse or promote products derived from
8235// this software without specific prior written permission.
8236//
8237// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8238// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8239// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8240// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8241// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8242// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8243// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8244// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8245// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8246// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8247// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8248//
8249// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
8250//
8251// The Google C++ Testing Framework (Google Test)
8252//
8253// This header file defines internal utilities needed for implementing
8254// death tests. They are subject to change without notice.
8255
8256#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8257#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8258
8259
8260#include <stdio.h>
8261
8262namespace testing {
8263namespace internal {
8264
8265GTEST_DECLARE_string_(internal_run_death_test);
8266
8267// Names of the flags (needed for parsing Google Test flags).
8268const char kDeathTestStyleFlag[] = "death_test_style";
8269const char kDeathTestUseFork[] = "death_test_use_fork";
8270const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
8271
8272#if GTEST_HAS_DEATH_TEST
8273
8274// DeathTest is a class that hides much of the complexity of the
8275// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
8276// returns a concrete class that depends on the prevailing death test
8277// style, as defined by the --gtest_death_test_style and/or
8278// --gtest_internal_run_death_test flags.
8279
8280// In describing the results of death tests, these terms are used with
8281// the corresponding definitions:
8282//
8283// exit status: The integer exit information in the format specified
8284// by wait(2)
8285// exit code: The integer code passed to exit(3), _exit(2), or
8286// returned from main()
8287class GTEST_API_ DeathTest {
8288 public:
8289 // Create returns false if there was an error determining the
8290 // appropriate action to take for the current death test; for example,
8291 // if the gtest_death_test_style flag is set to an invalid value.
8292 // The LastMessage method will return a more detailed message in that
8293 // case. Otherwise, the DeathTest pointer pointed to by the "test"
8294 // argument is set. If the death test should be skipped, the pointer
8295 // is set to NULL; otherwise, it is set to the address of a new concrete
8296 // DeathTest object that controls the execution of the current test.
8297 static bool Create(const char* statement, const RE* regex,
8298 const char* file, int line, DeathTest** test);
8299 DeathTest();
8300 virtual ~DeathTest() { }
8301
8302 // A helper class that aborts a death test when it's deleted.
8303 class ReturnSentinel {
8304 public:
8305 explicit ReturnSentinel(DeathTest* test) : test_(test) { }
8306 ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
8307 private:
8308 DeathTest* const test_;
8309 GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
8310 } GTEST_ATTRIBUTE_UNUSED_;
8311
8312 // An enumeration of possible roles that may be taken when a death
8313 // test is encountered. EXECUTE means that the death test logic should
8314 // be executed immediately. OVERSEE means that the program should prepare
8315 // the appropriate environment for a child process to execute the death
8316 // test, then wait for it to complete.
8317 enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
8318
8319 // An enumeration of the three reasons that a test might be aborted.
8320 enum AbortReason {
8321 TEST_ENCOUNTERED_RETURN_STATEMENT,
8322 TEST_THREW_EXCEPTION,
8323 TEST_DID_NOT_DIE
8324 };
8325
8326 // Assumes one of the above roles.
8327 virtual TestRole AssumeRole() = 0;
8328
8329 // Waits for the death test to finish and returns its status.
8330 virtual int Wait() = 0;
8331
8332 // Returns true if the death test passed; that is, the test process
8333 // exited during the test, its exit status matches a user-supplied
8334 // predicate, and its stderr output matches a user-supplied regular
8335 // expression.
8336 // The user-supplied predicate may be a macro expression rather
8337 // than a function pointer or functor, or else Wait and Passed could
8338 // be combined.
8339 virtual bool Passed(bool exit_status_ok) = 0;
8340
8341 // Signals that the death test did not die as expected.
8342 virtual void Abort(AbortReason reason) = 0;
8343
8344 // Returns a human-readable outcome message regarding the outcome of
8345 // the last death test.
8346 static const char* LastMessage();
8347
8348 static void set_last_death_test_message(const std::string& message);
8349
8350 private:
8351 // A string containing a description of the outcome of the last death test.
8352 static std::string last_death_test_message_;
8353
8354 GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
8355};
8356
8357// Factory interface for death tests. May be mocked out for testing.
8358class DeathTestFactory {
8359 public:
8360 virtual ~DeathTestFactory() { }
8361 virtual bool Create(const char* statement, const RE* regex,
8362 const char* file, int line, DeathTest** test) = 0;
8363};
8364
8365// A concrete DeathTestFactory implementation for normal use.
8366class DefaultDeathTestFactory : public DeathTestFactory {
8367 public:
8368 virtual bool Create(const char* statement, const RE* regex,
8369 const char* file, int line, DeathTest** test);
8370};
8371
8372// Returns true if exit_status describes a process that was terminated
8373// by a signal, or exited normally with a nonzero exit code.
8374GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
8375
8376// Traps C++ exceptions escaping statement and reports them as test
8377// failures. Note that trapping SEH exceptions is not implemented here.
8378# if GTEST_HAS_EXCEPTIONS
8379# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8380 try { \
8381 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8382 } catch (const ::std::exception& gtest_exception) { \
8383 fprintf(\
8384 stderr, \
8385 "\n%s: Caught std::exception-derived exception escaping the " \
8386 "death test statement. Exception message: %s\n", \
8387 ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
8388 gtest_exception.what()); \
8389 fflush(stderr); \
8390 death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8391 } catch (...) { \
8392 death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8393 }
8394
8395# else
8396# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8397 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
8398
8399# endif
8400
8401// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
8402// ASSERT_EXIT*, and EXPECT_EXIT*.
8403# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
8404 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8405 if (::testing::internal::AlwaysTrue()) { \
8406 const ::testing::internal::RE& gtest_regex = (regex); \
8407 ::testing::internal::DeathTest* gtest_dt; \
8408 if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
8409 __FILE__, __LINE__, &gtest_dt)) { \
8410 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8411 } \
8412 if (gtest_dt != NULL) { \
8413 ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
8414 gtest_dt_ptr(gtest_dt); \
8415 switch (gtest_dt->AssumeRole()) { \
8416 case ::testing::internal::DeathTest::OVERSEE_TEST: \
8417 if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
8418 goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8419 } \
8420 break; \
8421 case ::testing::internal::DeathTest::EXECUTE_TEST: { \
8422 ::testing::internal::DeathTest::ReturnSentinel \
8423 gtest_sentinel(gtest_dt); \
8424 GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
8425 gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
8426 break; \
8427 } \
8428 default: \
8429 break; \
8430 } \
8431 } \
8432 } else \
8433 GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
8434 fail(::testing::internal::DeathTest::LastMessage())
8435// The symbol "fail" here expands to something into which a message
8436// can be streamed.
8437
8438// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
8439// NDEBUG mode. In this case we need the statements to be executed, the regex is
8440// ignored, and the macro must accept a streamed message even though the message
8441// is never printed.
8442# define GTEST_EXECUTE_STATEMENT_(statement, regex) \
8443 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8444 if (::testing::internal::AlwaysTrue()) { \
8445 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8446 } else \
8447 ::testing::Message()
8448
8449// A class representing the parsed contents of the
8450// --gtest_internal_run_death_test flag, as it existed when
8451// RUN_ALL_TESTS was called.
8452class InternalRunDeathTestFlag {
8453 public:
8454 InternalRunDeathTestFlag(const std::string& a_file,
8455 int a_line,
8456 int an_index,
8457 int a_write_fd)
8458 : file_(a_file), line_(a_line), index_(an_index),
8459 write_fd_(a_write_fd) {}
8460
8461 ~InternalRunDeathTestFlag() {
8462 if (write_fd_ >= 0)
8463 posix::Close(write_fd_);
8464 }
8465
8466 const std::string& file() const { return file_; }
8467 int line() const { return line_; }
8468 int index() const { return index_; }
8469 int write_fd() const { return write_fd_; }
8470
8471 private:
8472 std::string file_;
8473 int line_;
8474 int index_;
8475 int write_fd_;
8476
8477 GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
8478};
8479
8480// Returns a newly created InternalRunDeathTestFlag object with fields
8481// initialized from the GTEST_FLAG(internal_run_death_test) flag if
8482// the flag is specified; otherwise returns NULL.
8483InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
8484
8485#else // GTEST_HAS_DEATH_TEST
8486
8487// This macro is used for implementing macros such as
8488// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
8489// death tests are not supported. Those macros must compile on such systems
8490// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
8491// systems that support death tests. This allows one to write such a macro
8492// on a system that does not support death tests and be sure that it will
8493// compile on a death-test supporting system.
8494//
8495// Parameters:
8496// statement - A statement that a macro such as EXPECT_DEATH would test
8497// for program termination. This macro has to make sure this
8498// statement is compiled but not executed, to ensure that
8499// EXPECT_DEATH_IF_SUPPORTED compiles with a certain
8500// parameter iff EXPECT_DEATH compiles with it.
8501// regex - A regex that a macro such as EXPECT_DEATH would use to test
8502// the output of statement. This parameter has to be
8503// compiled but not evaluated by this macro, to ensure that
8504// this macro only accepts expressions that a macro such as
8505// EXPECT_DEATH would accept.
8506// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
8507// and a return statement for ASSERT_DEATH_IF_SUPPORTED.
8508// This ensures that ASSERT_DEATH_IF_SUPPORTED will not
8509// compile inside functions where ASSERT_DEATH doesn't
8510// compile.
8511//
8512// The branch that has an always false condition is used to ensure that
8513// statement and regex are compiled (and thus syntactically correct) but
8514// never executed. The unreachable code macro protects the terminator
8515// statement from generating an 'unreachable code' warning in case
8516// statement unconditionally returns or throws. The Message constructor at
8517// the end allows the syntax of streaming additional messages into the
8518// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
8519# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
8520 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8521 if (::testing::internal::AlwaysTrue()) { \
8522 GTEST_LOG_(WARNING) \
8523 << "Death tests are not supported on this platform.\n" \
8524 << "Statement '" #statement "' cannot be verified."; \
8525 } else if (::testing::internal::AlwaysFalse()) { \
8526 ::testing::internal::RE::PartialMatch(".*", (regex)); \
8527 GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8528 terminator; \
8529 } else \
8530 ::testing::Message()
8531
8532#endif // GTEST_HAS_DEATH_TEST
8533
8534} // namespace internal
8535} // namespace testing
8536
8537#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8538
8539namespace testing {
8540
8541// This flag controls the style of death tests. Valid values are "threadsafe",
8542// meaning that the death test child process will re-execute the test binary
8543// from the start, running only a single death test, or "fast",
8544// meaning that the child process will execute the test logic immediately
8545// after forking.
8546GTEST_DECLARE_string_(death_test_style);
8547
8548#if GTEST_HAS_DEATH_TEST
8549
8550namespace internal {
8551
8552// Returns a Boolean value indicating whether the caller is currently
8553// executing in the context of the death test child process. Tools such as
8554// Valgrind heap checkers may need this to modify their behavior in death
8555// tests. IMPORTANT: This is an internal utility. Using it may break the
8556// implementation of death tests. User code MUST NOT use it.
8557GTEST_API_ bool InDeathTestChild();
8558
8559} // namespace internal
8560
8561// The following macros are useful for writing death tests.
8562
8563// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
8564// executed:
8565//
8566// 1. It generates a warning if there is more than one active
8567// thread. This is because it's safe to fork() or clone() only
8568// when there is a single thread.
8569//
8570// 2. The parent process clone()s a sub-process and runs the death
8571// test in it; the sub-process exits with code 0 at the end of the
8572// death test, if it hasn't exited already.
8573//
8574// 3. The parent process waits for the sub-process to terminate.
8575//
8576// 4. The parent process checks the exit code and error message of
8577// the sub-process.
8578//
8579// Examples:
8580//
8581// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
8582// for (int i = 0; i < 5; i++) {
8583// EXPECT_DEATH(server.ProcessRequest(i),
8584// "Invalid request .* in ProcessRequest()")
8585// << "Failed to die on request " << i;
8586// }
8587//
8588// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
8589//
8590// bool KilledBySIGHUP(int exit_code) {
8591// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
8592// }
8593//
8594// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
8595//
8596// On the regular expressions used in death tests:
8597//
8598// On POSIX-compliant systems (*nix), we use the <regex.h> library,
8599// which uses the POSIX extended regex syntax.
8600//
8601// On other platforms (e.g. Windows), we only support a simple regex
8602// syntax implemented as part of Google Test. This limited
8603// implementation should be enough most of the time when writing
8604// death tests; though it lacks many features you can find in PCRE
8605// or POSIX extended regex syntax. For example, we don't support
8606// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
8607// repetition count ("x{5,7}"), among others.
8608//
8609// Below is the syntax that we do support. We chose it to be a
8610// subset of both PCRE and POSIX extended regex, so it's easy to
8611// learn wherever you come from. In the following: 'A' denotes a
8612// literal character, period (.), or a single \\ escape sequence;
8613// 'x' and 'y' denote regular expressions; 'm' and 'n' are for
8614// natural numbers.
8615//
8616// c matches any literal character c
8617// \\d matches any decimal digit
8618// \\D matches any character that's not a decimal digit
8619// \\f matches \f
8620// \\n matches \n
8621// \\r matches \r
8622// \\s matches any ASCII whitespace, including \n
8623// \\S matches any character that's not a whitespace
8624// \\t matches \t
8625// \\v matches \v
8626// \\w matches any letter, _, or decimal digit
8627// \\W matches any character that \\w doesn't match
8628// \\c matches any literal character c, which must be a punctuation
8629// . matches any single character except \n
8630// A? matches 0 or 1 occurrences of A
8631// A* matches 0 or many occurrences of A
8632// A+ matches 1 or many occurrences of A
8633// ^ matches the beginning of a string (not that of each line)
8634// $ matches the end of a string (not that of each line)
8635// xy matches x followed by y
8636//
8637// If you accidentally use PCRE or POSIX extended regex features
8638// not implemented by us, you will get a run-time failure. In that
8639// case, please try to rewrite your regular expression within the
8640// above syntax.
8641//
8642// This implementation is *not* meant to be as highly tuned or robust
8643// as a compiled regex library, but should perform well enough for a
8644// death test, which already incurs significant overhead by launching
8645// a child process.
8646//
8647// Known caveats:
8648//
8649// A "threadsafe" style death test obtains the path to the test
8650// program from argv[0] and re-executes it in the sub-process. For
8651// simplicity, the current implementation doesn't search the PATH
8652// when launching the sub-process. This means that the user must
8653// invoke the test program via a path that contains at least one
8654// path separator (e.g. path/to/foo_test and
8655// /absolute/path/to/bar_test are fine, but foo_test is not). This
8656// is rarely a problem as people usually don't put the test binary
8657// directory in PATH.
8658//
8659// TODO(wan@google.com): make thread-safe death tests search the PATH.
8660
8661// Asserts that a given statement causes the program to exit, with an
8662// integer exit status that satisfies predicate, and emitting error output
8663// that matches regex.
8664# define ASSERT_EXIT(statement, predicate, regex) \
8665 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
8666
8667// Like ASSERT_EXIT, but continues on to successive tests in the
8668// test case, if any:
8669# define EXPECT_EXIT(statement, predicate, regex) \
8670 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
8671
8672// Asserts that a given statement causes the program to exit, either by
8673// explicitly exiting with a nonzero exit code or being killed by a
8674// signal, and emitting error output that matches regex.
8675# define ASSERT_DEATH(statement, regex) \
8676 ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8677
8678// Like ASSERT_DEATH, but continues on to successive tests in the
8679// test case, if any:
8680# define EXPECT_DEATH(statement, regex) \
8681 EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8682
8683// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
8684
8685// Tests that an exit code describes a normal exit with a given exit code.
8686class GTEST_API_ ExitedWithCode {
8687 public:
8688 explicit ExitedWithCode(int exit_code);
8689 bool operator()(int exit_status) const;
8690 private:
8691 // No implementation - assignment is unsupported.
8692 void operator=(const ExitedWithCode& other);
8693
8694 const int exit_code_;
8695};
8696
8697# if !GTEST_OS_WINDOWS
8698// Tests that an exit code describes an exit due to termination by a
8699// given signal.
8700class GTEST_API_ KilledBySignal {
8701 public:
8702 explicit KilledBySignal(int signum);
8703 bool operator()(int exit_status) const;
8704 private:
8705 const int signum_;
8706};
8707# endif // !GTEST_OS_WINDOWS
8708
8709// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
8710// The death testing framework causes this to have interesting semantics,
8711// since the sideeffects of the call are only visible in opt mode, and not
8712// in debug mode.
8713//
8714// In practice, this can be used to test functions that utilize the
8715// LOG(DFATAL) macro using the following style:
8716//
8717// int DieInDebugOr12(int* sideeffect) {
8718// if (sideeffect) {
8719// *sideeffect = 12;
8720// }
8721// LOG(DFATAL) << "death";
8722// return 12;
8723// }
8724//
8725// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
8726// int sideeffect = 0;
8727// // Only asserts in dbg.
8728// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
8729//
8730// #ifdef NDEBUG
8731// // opt-mode has sideeffect visible.
8732// EXPECT_EQ(12, sideeffect);
8733// #else
8734// // dbg-mode no visible sideeffect.
8735// EXPECT_EQ(0, sideeffect);
8736// #endif
8737// }
8738//
8739// This will assert that DieInDebugReturn12InOpt() crashes in debug
8740// mode, usually due to a DCHECK or LOG(DFATAL), but returns the
8741// appropriate fallback value (12 in this case) in opt mode. If you
8742// need to test that a function has appropriate side-effects in opt
8743// mode, include assertions against the side-effects. A general
8744// pattern for this is:
8745//
8746// EXPECT_DEBUG_DEATH({
8747// // Side-effects here will have an effect after this statement in
8748// // opt mode, but none in debug mode.
8749// EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
8750// }, "death");
8751//
8752# ifdef NDEBUG
8753
8754# define EXPECT_DEBUG_DEATH(statement, regex) \
8755 GTEST_EXECUTE_STATEMENT_(statement, regex)
8756
8757# define ASSERT_DEBUG_DEATH(statement, regex) \
8758 GTEST_EXECUTE_STATEMENT_(statement, regex)
8759
8760# else
8761
8762# define EXPECT_DEBUG_DEATH(statement, regex) \
8763 EXPECT_DEATH(statement, regex)
8764
8765# define ASSERT_DEBUG_DEATH(statement, regex) \
8766 ASSERT_DEATH(statement, regex)
8767
8768# endif // NDEBUG for EXPECT_DEBUG_DEATH
8769#endif // GTEST_HAS_DEATH_TEST
8770
8771// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
8772// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
8773// death tests are supported; otherwise they just issue a warning. This is
8774// useful when you are combining death test assertions with normal test
8775// assertions in one test.
8776#if GTEST_HAS_DEATH_TEST
8777# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8778 EXPECT_DEATH(statement, regex)
8779# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8780 ASSERT_DEATH(statement, regex)
8781#else
8782# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8783 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
8784# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8785 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
8786#endif
8787
8788} // namespace testing
8789
8790#endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8791// This file was GENERATED by command:
8792// pump.py gtest-param-test.h.pump
8793// DO NOT EDIT BY HAND!!!
8794
8795// Copyright 2008, Google Inc.
8796// All rights reserved.
8797//
8798// Redistribution and use in source and binary forms, with or without
8799// modification, are permitted provided that the following conditions are
8800// met:
8801//
8802// * Redistributions of source code must retain the above copyright
8803// notice, this list of conditions and the following disclaimer.
8804// * Redistributions in binary form must reproduce the above
8805// copyright notice, this list of conditions and the following disclaimer
8806// in the documentation and/or other materials provided with the
8807// distribution.
8808// * Neither the name of Google Inc. nor the names of its
8809// contributors may be used to endorse or promote products derived from
8810// this software without specific prior written permission.
8811//
8812// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8813// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8814// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8815// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8816// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8817// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8818// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8819// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8820// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8821// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8822// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8823//
8824// Authors: vladl@google.com (Vlad Losev)
8825//
8826// Macros and functions for implementing parameterized tests
8827// in Google C++ Testing Framework (Google Test)
8828//
8829// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
8830//
8831#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8832#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8833
8834
8835// Value-parameterized tests allow you to test your code with different
8836// parameters without writing multiple copies of the same test.
8837//
8838// Here is how you use value-parameterized tests:
8839
8840#if 0
8841
8842// To write value-parameterized tests, first you should define a fixture
8843// class. It is usually derived from testing::TestWithParam<T> (see below for
8844// another inheritance scheme that's sometimes useful in more complicated
8845// class hierarchies), where the type of your parameter values.
8846// TestWithParam<T> is itself derived from testing::Test. T can be any
8847// copyable type. If it's a raw pointer, you are responsible for managing the
8848// lifespan of the pointed values.
8849
8850class FooTest : public ::testing::TestWithParam<const char*> {
8851 // You can implement all the usual class fixture members here.
8852};
8853
8854// Then, use the TEST_P macro to define as many parameterized tests
8855// for this fixture as you want. The _P suffix is for "parameterized"
8856// or "pattern", whichever you prefer to think.
8857
8858TEST_P(FooTest, DoesBlah) {
8859 // Inside a test, access the test parameter with the GetParam() method
8860 // of the TestWithParam<T> class:
8861 EXPECT_TRUE(foo.Blah(GetParam()));
8862 ...
8863}
8864
8865TEST_P(FooTest, HasBlahBlah) {
8866 ...
8867}
8868
8869// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
8870// case with any set of parameters you want. Google Test defines a number
8871// of functions for generating test parameters. They return what we call
8872// (surprise!) parameter generators. Here is a summary of them, which
8873// are all in the testing namespace:
8874//
8875//
8876// Range(begin, end [, step]) - Yields values {begin, begin+step,
8877// begin+step+step, ...}. The values do not
8878// include end. step defaults to 1.
8879// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
8880// ValuesIn(container) - Yields values from a C-style array, an STL
8881// ValuesIn(begin,end) container, or an iterator range [begin, end).
8882// Bool() - Yields sequence {false, true}.
8883// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
8884// for the math savvy) of the values generated
8885// by the N generators.
8886//
8887// For more details, see comments at the definitions of these functions below
8888// in this file.
8889//
8890// The following statement will instantiate tests from the FooTest test case
8891// each with parameter values "meeny", "miny", and "moe".
8892
8893INSTANTIATE_TEST_CASE_P(InstantiationName,
8894 FooTest,
8895 Values("meeny", "miny", "moe"));
8896
8897// To distinguish different instances of the pattern, (yes, you
8898// can instantiate it more then once) the first argument to the
8899// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
8900// actual test case name. Remember to pick unique prefixes for different
8901// instantiations. The tests from the instantiation above will have
8902// these names:
8903//
8904// * InstantiationName/FooTest.DoesBlah/0 for "meeny"
8905// * InstantiationName/FooTest.DoesBlah/1 for "miny"
8906// * InstantiationName/FooTest.DoesBlah/2 for "moe"
8907// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
8908// * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
8909// * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
8910//
8911// You can use these names in --gtest_filter.
8912//
8913// This statement will instantiate all tests from FooTest again, each
8914// with parameter values "cat" and "dog":
8915
8916const char* pets[] = {"cat", "dog"};
8917INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
8918
8919// The tests from the instantiation above will have these names:
8920//
8921// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
8922// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
8923// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
8924// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
8925//
8926// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
8927// in the given test case, whether their definitions come before or
8928// AFTER the INSTANTIATE_TEST_CASE_P statement.
8929//
8930// Please also note that generator expressions (including parameters to the
8931// generators) are evaluated in InitGoogleTest(), after main() has started.
8932// This allows the user on one hand, to adjust generator parameters in order
8933// to dynamically determine a set of tests to run and on the other hand,
8934// give the user a chance to inspect the generated tests with Google Test
8935// reflection API before RUN_ALL_TESTS() is executed.
8936//
8937// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
8938// for more examples.
8939//
8940// In the future, we plan to publish the API for defining new parameter
8941// generators. But for now this interface remains part of the internal
8942// implementation and is subject to change.
8943//
8944//
8945// A parameterized test fixture must be derived from testing::Test and from
8946// testing::WithParamInterface<T>, where T is the type of the parameter
8947// values. Inheriting from TestWithParam<T> satisfies that requirement because
8948// TestWithParam<T> inherits from both Test and WithParamInterface. In more
8949// complicated hierarchies, however, it is occasionally useful to inherit
8950// separately from Test and WithParamInterface. For example:
8951
8952class BaseTest : public ::testing::Test {
8953 // You can inherit all the usual members for a non-parameterized test
8954 // fixture here.
8955};
8956
8957class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
8958 // The usual test fixture members go here too.
8959};
8960
8961TEST_F(BaseTest, HasFoo) {
8962 // This is an ordinary non-parameterized test.
8963}
8964
8965TEST_P(DerivedTest, DoesBlah) {
8966 // GetParam works just the same here as if you inherit from TestWithParam.
8967 EXPECT_TRUE(foo.Blah(GetParam()));
8968}
8969
8970#endif // 0
8971
8972
8973#if !GTEST_OS_SYMBIAN
8974# include <utility>
8975#endif
8976
8977// scripts/fuse_gtest.py depends on gtest's own header being #included
8978// *unconditionally*. Therefore these #includes cannot be moved
8979// inside #if GTEST_HAS_PARAM_TEST.
8980// Copyright 2008 Google Inc.
8981// All Rights Reserved.
8982//
8983// Redistribution and use in source and binary forms, with or without
8984// modification, are permitted provided that the following conditions are
8985// met:
8986//
8987// * Redistributions of source code must retain the above copyright
8988// notice, this list of conditions and the following disclaimer.
8989// * Redistributions in binary form must reproduce the above
8990// copyright notice, this list of conditions and the following disclaimer
8991// in the documentation and/or other materials provided with the
8992// distribution.
8993// * Neither the name of Google Inc. nor the names of its
8994// contributors may be used to endorse or promote products derived from
8995// this software without specific prior written permission.
8996//
8997// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8998// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8999// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9000// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9001// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9002// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9003// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9004// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9005// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9006// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9007// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9008//
9009// Author: vladl@google.com (Vlad Losev)
9010
9011// Type and function utilities for implementing parameterized tests.
9012
9013#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
9014#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
9015
9016#include <iterator>
9017#include <utility>
9018#include <vector>
9019
9020// scripts/fuse_gtest.py depends on gtest's own header being #included
9021// *unconditionally*. Therefore these #includes cannot be moved
9022// inside #if GTEST_HAS_PARAM_TEST.
9023// Copyright 2003 Google Inc.
9024// All rights reserved.
9025//
9026// Redistribution and use in source and binary forms, with or without
9027// modification, are permitted provided that the following conditions are
9028// met:
9029//
9030// * Redistributions of source code must retain the above copyright
9031// notice, this list of conditions and the following disclaimer.
9032// * Redistributions in binary form must reproduce the above
9033// copyright notice, this list of conditions and the following disclaimer
9034// in the documentation and/or other materials provided with the
9035// distribution.
9036// * Neither the name of Google Inc. nor the names of its
9037// contributors may be used to endorse or promote products derived from
9038// this software without specific prior written permission.
9039//
9040// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9041// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9042// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9043// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9044// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9045// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9046// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9047// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9048// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9049// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9050// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9051//
9052// Authors: Dan Egnor (egnor@google.com)
9053//
9054// A "smart" pointer type with reference tracking. Every pointer to a
9055// particular object is kept on a circular linked list. When the last pointer
9056// to an object is destroyed or reassigned, the object is deleted.
9057//
9058// Used properly, this deletes the object when the last reference goes away.
9059// There are several caveats:
9060// - Like all reference counting schemes, cycles lead to leaks.
9061// - Each smart pointer is actually two pointers (8 bytes instead of 4).
9062// - Every time a pointer is assigned, the entire list of pointers to that
9063// object is traversed. This class is therefore NOT SUITABLE when there
9064// will often be more than two or three pointers to a particular object.
9065// - References are only tracked as long as linked_ptr<> objects are copied.
9066// If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
9067// will happen (double deletion).
9068//
9069// A good use of this class is storing object references in STL containers.
9070// You can safely put linked_ptr<> in a vector<>.
9071// Other uses may not be as good.
9072//
9073// Note: If you use an incomplete type with linked_ptr<>, the class
9074// *containing* linked_ptr<> must have a constructor and destructor (even
9075// if they do nothing!).
9076//
9077// Bill Gibbons suggested we use something like this.
9078//
9079// Thread Safety:
9080// Unlike other linked_ptr implementations, in this implementation
9081// a linked_ptr object is thread-safe in the sense that:
9082// - it's safe to copy linked_ptr objects concurrently,
9083// - it's safe to copy *from* a linked_ptr and read its underlying
9084// raw pointer (e.g. via get()) concurrently, and
9085// - it's safe to write to two linked_ptrs that point to the same
9086// shared object concurrently.
9087// TODO(wan@google.com): rename this to safe_linked_ptr to avoid
9088// confusion with normal linked_ptr.
9089
9090#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9091#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9092
9093#include <stdlib.h>
9094#include <assert.h>
9095
9096
9097namespace testing {
9098namespace internal {
9099
9100// Protects copying of all linked_ptr objects.
9101GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
9102
9103// This is used internally by all instances of linked_ptr<>. It needs to be
9104// a non-template class because different types of linked_ptr<> can refer to
9105// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
9106// So, it needs to be possible for different types of linked_ptr to participate
9107// in the same circular linked list, so we need a single class type here.
9108//
9109// DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
9110class linked_ptr_internal {
9111 public:
9112 // Create a new circle that includes only this instance.
9113 void join_new() {
9114 next_ = this;
9115 }
9116
9117 // Many linked_ptr operations may change p.link_ for some linked_ptr
9118 // variable p in the same circle as this object. Therefore we need
9119 // to prevent two such operations from occurring concurrently.
9120 //
9121 // Note that different types of linked_ptr objects can coexist in a
9122 // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
9123 // linked_ptr<Derived2>). Therefore we must use a single mutex to
9124 // protect all linked_ptr objects. This can create serious
9125 // contention in production code, but is acceptable in a testing
9126 // framework.
9127
9128 // Join an existing circle.
9129 void join(linked_ptr_internal const* ptr)
9130 GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9131 MutexLock lock(&g_linked_ptr_mutex);
9132
9133 linked_ptr_internal const* p = ptr;
9134 while (p->next_ != ptr) p = p->next_;
9135 p->next_ = this;
9136 next_ = ptr;
9137 }
9138
9139 // Leave whatever circle we're part of. Returns true if we were the
9140 // last member of the circle. Once this is done, you can join() another.
9141 bool depart()
9142 GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9143 MutexLock lock(&g_linked_ptr_mutex);
9144
9145 if (next_ == this) return true;
9146 linked_ptr_internal const* p = next_;
9147 while (p->next_ != this) p = p->next_;
9148 p->next_ = next_;
9149 return false;
9150 }
9151
9152 private:
9153 mutable linked_ptr_internal const* next_;
9154};
9155
9156template <typename T>
9157class linked_ptr {
9158 public:
9159 typedef T element_type;
9160
9161 // Take over ownership of a raw pointer. This should happen as soon as
9162 // possible after the object is created.
9163 explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
9164 ~linked_ptr() { depart(); }
9165
9166 // Copy an existing linked_ptr<>, adding ourselves to the list of references.
9167 template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
9168 linked_ptr(linked_ptr const& ptr) { // NOLINT
9169 assert(&ptr != this);
9170 copy(&ptr);
9171 }
9172
9173 // Assignment releases the old value and acquires the new.
9174 template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
9175 depart();
9176 copy(&ptr);
9177 return *this;
9178 }
9179
9180 linked_ptr& operator=(linked_ptr const& ptr) {
9181 if (&ptr != this) {
9182 depart();
9183 copy(&ptr);
9184 }
9185 return *this;
9186 }
9187
9188 // Smart pointer members.
9189 void reset(T* ptr = NULL) {
9190 depart();
9191 capture(ptr);
9192 }
9193 T* get() const { return value_; }
9194 T* operator->() const { return value_; }
9195 T& operator*() const { return *value_; }
9196
9197 bool operator==(T* p) const { return value_ == p; }
9198 bool operator!=(T* p) const { return value_ != p; }
9199 template <typename U>
9200 bool operator==(linked_ptr<U> const& ptr) const {
9201 return value_ == ptr.get();
9202 }
9203 template <typename U>
9204 bool operator!=(linked_ptr<U> const& ptr) const {
9205 return value_ != ptr.get();
9206 }
9207
9208 private:
9209 template <typename U>
9210 friend class linked_ptr;
9211
9212 T* value_;
9213 linked_ptr_internal link_;
9214
9215 void depart() {
9216 if (link_.depart()) delete value_;
9217 }
9218
9219 void capture(T* ptr) {
9220 value_ = ptr;
9221 link_.join_new();
9222 }
9223
9224 template <typename U> void copy(linked_ptr<U> const* ptr) {
9225 value_ = ptr->get();
9226 if (value_)
9227 link_.join(&ptr->link_);
9228 else
9229 link_.join_new();
9230 }
9231};
9232
9233template<typename T> inline
9234bool operator==(T* ptr, const linked_ptr<T>& x) {
9235 return ptr == x.get();
9236}
9237
9238template<typename T> inline
9239bool operator!=(T* ptr, const linked_ptr<T>& x) {
9240 return ptr != x.get();
9241}
9242
9243// A function to convert T* into linked_ptr<T>
9244// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
9245// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
9246template <typename T>
9247linked_ptr<T> make_linked_ptr(T* ptr) {
9248 return linked_ptr<T>(ptr);
9249}
9250
9251} // namespace internal
9252} // namespace testing
9253
9254#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9255// Copyright 2007, Google Inc.
9256// All rights reserved.
9257//
9258// Redistribution and use in source and binary forms, with or without
9259// modification, are permitted provided that the following conditions are
9260// met:
9261//
9262// * Redistributions of source code must retain the above copyright
9263// notice, this list of conditions and the following disclaimer.
9264// * Redistributions in binary form must reproduce the above
9265// copyright notice, this list of conditions and the following disclaimer
9266// in the documentation and/or other materials provided with the
9267// distribution.
9268// * Neither the name of Google Inc. nor the names of its
9269// contributors may be used to endorse or promote products derived from
9270// this software without specific prior written permission.
9271//
9272// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9273// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9274// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9275// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9276// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9277// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9278// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9279// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9280// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9281// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9282// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9283//
9284// Author: wan@google.com (Zhanyong Wan)
9285
9286// Google Test - The Google C++ Testing Framework
9287//
9288// This file implements a universal value printer that can print a
9289// value of any type T:
9290//
9291// void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
9292//
9293// A user can teach this function how to print a class type T by
9294// defining either operator<<() or PrintTo() in the namespace that
9295// defines T. More specifically, the FIRST defined function in the
9296// following list will be used (assuming T is defined in namespace
9297// foo):
9298//
9299// 1. foo::PrintTo(const T&, ostream*)
9300// 2. operator<<(ostream&, const T&) defined in either foo or the
9301// global namespace.
9302//
9303// If none of the above is defined, it will print the debug string of
9304// the value if it is a protocol buffer, or print the raw bytes in the
9305// value otherwise.
9306//
9307// To aid debugging: when T is a reference type, the address of the
9308// value is also printed; when T is a (const) char pointer, both the
9309// pointer value and the NUL-terminated string it points to are
9310// printed.
9311//
9312// We also provide some convenient wrappers:
9313//
9314// // Prints a value to a string. For a (const or not) char
9315// // pointer, the NUL-terminated string (but not the pointer) is
9316// // printed.
9317// std::string ::testing::PrintToString(const T& value);
9318//
9319// // Prints a value tersely: for a reference type, the referenced
9320// // value (but not the address) is printed; for a (const or not) char
9321// // pointer, the NUL-terminated string (but not the pointer) is
9322// // printed.
9323// void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
9324//
9325// // Prints value using the type inferred by the compiler. The difference
9326// // from UniversalTersePrint() is that this function prints both the
9327// // pointer and the NUL-terminated string for a (const or not) char pointer.
9328// void ::testing::internal::UniversalPrint(const T& value, ostream*);
9329//
9330// // Prints the fields of a tuple tersely to a string vector, one
9331// // element for each field. Tuple support must be enabled in
9332// // gtest-port.h.
9333// std::vector<string> UniversalTersePrintTupleFieldsToStrings(
9334// const Tuple& value);
9335//
9336// Known limitation:
9337//
9338// The print primitives print the elements of an STL-style container
9339// using the compiler-inferred type of *iter where iter is a
9340// const_iterator of the container. When const_iterator is an input
9341// iterator but not a forward iterator, this inferred type may not
9342// match value_type, and the print output may be incorrect. In
9343// practice, this is rarely a problem as for most containers
9344// const_iterator is a forward iterator. We'll fix this if there's an
9345// actual need for it. Note that this fix cannot rely on value_type
9346// being defined as many user-defined container types don't have
9347// value_type.
9348
9349#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9350#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9351
9352#include <ostream> // NOLINT
9353#include <sstream>
9354#include <string>
9355#include <utility>
9356#include <vector>
9357
9358namespace testing {
9359
9360// Definitions in the 'internal' and 'internal2' name spaces are
9361// subject to change without notice. DO NOT USE THEM IN USER CODE!
9362namespace internal2 {
9363
9364// Prints the given number of bytes in the given object to the given
9365// ostream.
9366GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
9367 size_t count,
9368 ::std::ostream* os);
9369
9370// For selecting which printer to use when a given type has neither <<
9371// nor PrintTo().
9372enum TypeKind {
9373 kProtobuf, // a protobuf type
9374 kConvertibleToInteger, // a type implicitly convertible to BiggestInt
9375 // (e.g. a named or unnamed enum type)
9376 kOtherType // anything else
9377};
9378
9379// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
9380// by the universal printer to print a value of type T when neither
9381// operator<< nor PrintTo() is defined for T, where kTypeKind is the
9382// "kind" of T as defined by enum TypeKind.
9383template <typename T, TypeKind kTypeKind>
9384class TypeWithoutFormatter {
9385 public:
9386 // This default version is called when kTypeKind is kOtherType.
9387 static void PrintValue(const T& value, ::std::ostream* os) {
9388 PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
9389 sizeof(value), os);
9390 }
9391};
9392
9393// We print a protobuf using its ShortDebugString() when the string
9394// doesn't exceed this many characters; otherwise we print it using
9395// DebugString() for better readability.
9396const size_t kProtobufOneLinerMaxLength = 50;
9397
9398template <typename T>
9399class TypeWithoutFormatter<T, kProtobuf> {
9400 public:
9401 static void PrintValue(const T& value, ::std::ostream* os) {
9402 const ::testing::internal::string short_str = value.ShortDebugString();
9403 const ::testing::internal::string pretty_str =
9404 short_str.length() <= kProtobufOneLinerMaxLength ?
9405 short_str : ("\n" + value.DebugString());
9406 *os << ("<" + pretty_str + ">");
9407 }
9408};
9409
9410template <typename T>
9411class TypeWithoutFormatter<T, kConvertibleToInteger> {
9412 public:
9413 // Since T has no << operator or PrintTo() but can be implicitly
9414 // converted to BiggestInt, we print it as a BiggestInt.
9415 //
9416 // Most likely T is an enum type (either named or unnamed), in which
9417 // case printing it as an integer is the desired behavior. In case
9418 // T is not an enum, printing it as an integer is the best we can do
9419 // given that it has no user-defined printer.
9420 static void PrintValue(const T& value, ::std::ostream* os) {
9421 const internal::BiggestInt kBigInt = value;
9422 *os << kBigInt;
9423 }
9424};
9425
9426// Prints the given value to the given ostream. If the value is a
9427// protocol message, its debug string is printed; if it's an enum or
9428// of a type implicitly convertible to BiggestInt, it's printed as an
9429// integer; otherwise the bytes in the value are printed. This is
9430// what UniversalPrinter<T>::Print() does when it knows nothing about
9431// type T and T has neither << operator nor PrintTo().
9432//
9433// A user can override this behavior for a class type Foo by defining
9434// a << operator in the namespace where Foo is defined.
9435//
9436// We put this operator in namespace 'internal2' instead of 'internal'
9437// to simplify the implementation, as much code in 'internal' needs to
9438// use << in STL, which would conflict with our own << were it defined
9439// in 'internal'.
9440//
9441// Note that this operator<< takes a generic std::basic_ostream<Char,
9442// CharTraits> type instead of the more restricted std::ostream. If
9443// we define it to take an std::ostream instead, we'll get an
9444// "ambiguous overloads" compiler error when trying to print a type
9445// Foo that supports streaming to std::basic_ostream<Char,
9446// CharTraits>, as the compiler cannot tell whether
9447// operator<<(std::ostream&, const T&) or
9448// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
9449// specific.
9450template <typename Char, typename CharTraits, typename T>
9451::std::basic_ostream<Char, CharTraits>& operator<<(
9452 ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
9453 TypeWithoutFormatter<T,
9454 (internal::IsAProtocolMessage<T>::value ? kProtobuf :
9455 internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
9456 kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
9457 return os;
9458}
9459
9460} // namespace internal2
9461} // namespace testing
9462
9463// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
9464// magic needed for implementing UniversalPrinter won't work.
9465namespace testing_internal {
9466
9467// Used to print a value that is not an STL-style container when the
9468// user doesn't define PrintTo() for it.
9469template <typename T>
9470void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
9471 // With the following statement, during unqualified name lookup,
9472 // testing::internal2::operator<< appears as if it was declared in
9473 // the nearest enclosing namespace that contains both
9474 // ::testing_internal and ::testing::internal2, i.e. the global
9475 // namespace. For more details, refer to the C++ Standard section
9476 // 7.3.4-1 [namespace.udir]. This allows us to fall back onto
9477 // testing::internal2::operator<< in case T doesn't come with a <<
9478 // operator.
9479 //
9480 // We cannot write 'using ::testing::internal2::operator<<;', which
9481 // gcc 3.3 fails to compile due to a compiler bug.
9482 using namespace ::testing::internal2; // NOLINT
9483
9484 // Assuming T is defined in namespace foo, in the next statement,
9485 // the compiler will consider all of:
9486 //
9487 // 1. foo::operator<< (thanks to Koenig look-up),
9488 // 2. ::operator<< (as the current namespace is enclosed in ::),
9489 // 3. testing::internal2::operator<< (thanks to the using statement above).
9490 //
9491 // The operator<< whose type matches T best will be picked.
9492 //
9493 // We deliberately allow #2 to be a candidate, as sometimes it's
9494 // impossible to define #1 (e.g. when foo is ::std, defining
9495 // anything in it is undefined behavior unless you are a compiler
9496 // vendor.).
9497 *os << value;
9498}
9499
9500} // namespace testing_internal
9501
9502namespace testing {
9503namespace internal {
9504
9505// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
9506// value to the given ostream. The caller must ensure that
9507// 'ostream_ptr' is not NULL, or the behavior is undefined.
9508//
9509// We define UniversalPrinter as a class template (as opposed to a
9510// function template), as we need to partially specialize it for
9511// reference types, which cannot be done with function templates.
9512template <typename T>
9513class UniversalPrinter;
9514
9515template <typename T>
9516void UniversalPrint(const T& value, ::std::ostream* os);
9517
9518// Used to print an STL-style container when the user doesn't define
9519// a PrintTo() for it.
9520template <typename C>
9521void DefaultPrintTo(IsContainer /* dummy */,
9522 false_type /* is not a pointer */,
9523 const C& container, ::std::ostream* os) {
9524 const size_t kMaxCount = 32; // The maximum number of elements to print.
9525 *os << '{';
9526 size_t count = 0;
9527 for (typename C::const_iterator it = container.begin();
9528 it != container.end(); ++it, ++count) {
9529 if (count > 0) {
9530 *os << ',';
9531 if (count == kMaxCount) { // Enough has been printed.
9532 *os << " ...";
9533 break;
9534 }
9535 }
9536 *os << ' ';
9537 // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
9538 // handle *it being a native array.
9539 internal::UniversalPrint(*it, os);
9540 }
9541
9542 if (count > 0) {
9543 *os << ' ';
9544 }
9545 *os << '}';
9546}
9547
9548// Used to print a pointer that is neither a char pointer nor a member
9549// pointer, when the user doesn't define PrintTo() for it. (A member
9550// variable pointer or member function pointer doesn't really point to
9551// a location in the address space. Their representation is
9552// implementation-defined. Therefore they will be printed as raw
9553// bytes.)
9554template <typename T>
9555void DefaultPrintTo(IsNotContainer /* dummy */,
9556 true_type /* is a pointer */,
9557 T* p, ::std::ostream* os) {
9558 if (p == NULL) {
9559 *os << "NULL";
9560 } else {
9561 // C++ doesn't allow casting from a function pointer to any object
9562 // pointer.
9563 //
9564 // IsTrue() silences warnings: "Condition is always true",
9565 // "unreachable code".
9566 if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
9567 // T is not a function type. We just call << to print p,
9568 // relying on ADL to pick up user-defined << for their pointer
9569 // types, if any.
9570 *os << p;
9571 } else {
9572 // T is a function type, so '*os << p' doesn't do what we want
9573 // (it just prints p as bool). We want to print p as a const
9574 // void*. However, we cannot cast it to const void* directly,
9575 // even using reinterpret_cast, as earlier versions of gcc
9576 // (e.g. 3.4.5) cannot compile the cast when p is a function
9577 // pointer. Casting to UInt64 first solves the problem.
9578 *os << reinterpret_cast<const void*>(
9579 reinterpret_cast<internal::UInt64>(p));
9580 }
9581 }
9582}
9583
9584// Used to print a non-container, non-pointer value when the user
9585// doesn't define PrintTo() for it.
9586template <typename T>
9587void DefaultPrintTo(IsNotContainer /* dummy */,
9588 false_type /* is not a pointer */,
9589 const T& value, ::std::ostream* os) {
9590 ::testing_internal::DefaultPrintNonContainerTo(value, os);
9591}
9592
9593// Prints the given value using the << operator if it has one;
9594// otherwise prints the bytes in it. This is what
9595// UniversalPrinter<T>::Print() does when PrintTo() is not specialized
9596// or overloaded for type T.
9597//
9598// A user can override this behavior for a class type Foo by defining
9599// an overload of PrintTo() in the namespace where Foo is defined. We
9600// give the user this option as sometimes defining a << operator for
9601// Foo is not desirable (e.g. the coding style may prevent doing it,
9602// or there is already a << operator but it doesn't do what the user
9603// wants).
9604template <typename T>
9605void PrintTo(const T& value, ::std::ostream* os) {
9606 // DefaultPrintTo() is overloaded. The type of its first two
9607 // arguments determine which version will be picked. If T is an
9608 // STL-style container, the version for container will be called; if
9609 // T is a pointer, the pointer version will be called; otherwise the
9610 // generic version will be called.
9611 //
9612 // Note that we check for container types here, prior to we check
9613 // for protocol message types in our operator<<. The rationale is:
9614 //
9615 // For protocol messages, we want to give people a chance to
9616 // override Google Mock's format by defining a PrintTo() or
9617 // operator<<. For STL containers, other formats can be
9618 // incompatible with Google Mock's format for the container
9619 // elements; therefore we check for container types here to ensure
9620 // that our format is used.
9621 //
9622 // The second argument of DefaultPrintTo() is needed to bypass a bug
9623 // in Symbian's C++ compiler that prevents it from picking the right
9624 // overload between:
9625 //
9626 // PrintTo(const T& x, ...);
9627 // PrintTo(T* x, ...);
9628 DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
9629}
9630
9631// The following list of PrintTo() overloads tells
9632// UniversalPrinter<T>::Print() how to print standard types (built-in
9633// types, strings, plain arrays, and pointers).
9634
9635// Overloads for various char types.
9636GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
9637GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
9638inline void PrintTo(char c, ::std::ostream* os) {
9639 // When printing a plain char, we always treat it as unsigned. This
9640 // way, the output won't be affected by whether the compiler thinks
9641 // char is signed or not.
9642 PrintTo(static_cast<unsigned char>(c), os);
9643}
9644
9645// Overloads for other simple built-in types.
9646inline void PrintTo(bool x, ::std::ostream* os) {
9647 *os << (x ? "true" : "false");
9648}
9649
9650// Overload for wchar_t type.
9651// Prints a wchar_t as a symbol if it is printable or as its internal
9652// code otherwise and also as its decimal code (except for L'\0').
9653// The L'\0' char is printed as "L'\\0'". The decimal code is printed
9654// as signed integer when wchar_t is implemented by the compiler
9655// as a signed type and is printed as an unsigned integer when wchar_t
9656// is implemented as an unsigned type.
9657GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
9658
9659// Overloads for C strings.
9660GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
9661inline void PrintTo(char* s, ::std::ostream* os) {
9662 PrintTo(ImplicitCast_<const char*>(s), os);
9663}
9664
9665// signed/unsigned char is often used for representing binary data, so
9666// we print pointers to it as void* to be safe.
9667inline void PrintTo(const signed char* s, ::std::ostream* os) {
9668 PrintTo(ImplicitCast_<const void*>(s), os);
9669}
9670inline void PrintTo(signed char* s, ::std::ostream* os) {
9671 PrintTo(ImplicitCast_<const void*>(s), os);
9672}
9673inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
9674 PrintTo(ImplicitCast_<const void*>(s), os);
9675}
9676inline void PrintTo(unsigned char* s, ::std::ostream* os) {
9677 PrintTo(ImplicitCast_<const void*>(s), os);
9678}
9679
9680// MSVC can be configured to define wchar_t as a typedef of unsigned
9681// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
9682// type. When wchar_t is a typedef, defining an overload for const
9683// wchar_t* would cause unsigned short* be printed as a wide string,
9684// possibly causing invalid memory accesses.
9685#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
9686// Overloads for wide C strings
9687GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
9688inline void PrintTo(wchar_t* s, ::std::ostream* os) {
9689 PrintTo(ImplicitCast_<const wchar_t*>(s), os);
9690}
9691#endif
9692
9693// Overload for C arrays. Multi-dimensional arrays are printed
9694// properly.
9695
9696// Prints the given number of elements in an array, without printing
9697// the curly braces.
9698template <typename T>
9699void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
9700 UniversalPrint(a[0], os);
9701 for (size_t i = 1; i != count; i++) {
9702 *os << ", ";
9703 UniversalPrint(a[i], os);
9704 }
9705}
9706
9707// Overloads for ::string and ::std::string.
9708#if GTEST_HAS_GLOBAL_STRING
9709GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
9710inline void PrintTo(const ::string& s, ::std::ostream* os) {
9711 PrintStringTo(s, os);
9712}
9713#endif // GTEST_HAS_GLOBAL_STRING
9714
9715GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
9716inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
9717 PrintStringTo(s, os);
9718}
9719
9720// Overloads for ::wstring and ::std::wstring.
9721#if GTEST_HAS_GLOBAL_WSTRING
9722GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
9723inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
9724 PrintWideStringTo(s, os);
9725}
9726#endif // GTEST_HAS_GLOBAL_WSTRING
9727
9728#if GTEST_HAS_STD_WSTRING
9729GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
9730inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
9731 PrintWideStringTo(s, os);
9732}
9733#endif // GTEST_HAS_STD_WSTRING
9734
9735#if GTEST_HAS_TR1_TUPLE
9736// Overload for ::std::tr1::tuple. Needed for printing function arguments,
9737// which are packed as tuples.
9738
9739// Helper function for printing a tuple. T must be instantiated with
9740// a tuple type.
9741template <typename T>
9742void PrintTupleTo(const T& t, ::std::ostream* os);
9743
9744// Overloaded PrintTo() for tuples of various arities. We support
9745// tuples of up-to 10 fields. The following implementation works
9746// regardless of whether tr1::tuple is implemented using the
9747// non-standard variadic template feature or not.
9748
9749inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
9750 PrintTupleTo(t, os);
9751}
9752
9753template <typename T1>
9754void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
9755 PrintTupleTo(t, os);
9756}
9757
9758template <typename T1, typename T2>
9759void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
9760 PrintTupleTo(t, os);
9761}
9762
9763template <typename T1, typename T2, typename T3>
9764void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
9765 PrintTupleTo(t, os);
9766}
9767
9768template <typename T1, typename T2, typename T3, typename T4>
9769void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
9770 PrintTupleTo(t, os);
9771}
9772
9773template <typename T1, typename T2, typename T3, typename T4, typename T5>
9774void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
9775 ::std::ostream* os) {
9776 PrintTupleTo(t, os);
9777}
9778
9779template <typename T1, typename T2, typename T3, typename T4, typename T5,
9780 typename T6>
9781void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
9782 ::std::ostream* os) {
9783 PrintTupleTo(t, os);
9784}
9785
9786template <typename T1, typename T2, typename T3, typename T4, typename T5,
9787 typename T6, typename T7>
9788void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
9789 ::std::ostream* os) {
9790 PrintTupleTo(t, os);
9791}
9792
9793template <typename T1, typename T2, typename T3, typename T4, typename T5,
9794 typename T6, typename T7, typename T8>
9795void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
9796 ::std::ostream* os) {
9797 PrintTupleTo(t, os);
9798}
9799
9800template <typename T1, typename T2, typename T3, typename T4, typename T5,
9801 typename T6, typename T7, typename T8, typename T9>
9802void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
9803 ::std::ostream* os) {
9804 PrintTupleTo(t, os);
9805}
9806
9807template <typename T1, typename T2, typename T3, typename T4, typename T5,
9808 typename T6, typename T7, typename T8, typename T9, typename T10>
9809void PrintTo(
9810 const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
9811 ::std::ostream* os) {
9812 PrintTupleTo(t, os);
9813}
9814#endif // GTEST_HAS_TR1_TUPLE
9815
9816// Overload for std::pair.
9817template <typename T1, typename T2>
9818void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
9819 *os << '(';
9820 // We cannot use UniversalPrint(value.first, os) here, as T1 may be
9821 // a reference type. The same for printing value.second.
9822 UniversalPrinter<T1>::Print(value.first, os);
9823 *os << ", ";
9824 UniversalPrinter<T2>::Print(value.second, os);
9825 *os << ')';
9826}
9827
9828// Implements printing a non-reference type T by letting the compiler
9829// pick the right overload of PrintTo() for T.
9830template <typename T>
9831class UniversalPrinter {
9832 public:
9833 // MSVC warns about adding const to a function type, so we want to
9834 // disable the warning.
9835#ifdef _MSC_VER
9836# pragma warning(push) // Saves the current warning state.
9837# pragma warning(disable:4180) // Temporarily disables warning 4180.
9838#endif // _MSC_VER
9839
9840 // Note: we deliberately don't call this PrintTo(), as that name
9841 // conflicts with ::testing::internal::PrintTo in the body of the
9842 // function.
9843 static void Print(const T& value, ::std::ostream* os) {
9844 // By default, ::testing::internal::PrintTo() is used for printing
9845 // the value.
9846 //
9847 // Thanks to Koenig look-up, if T is a class and has its own
9848 // PrintTo() function defined in its namespace, that function will
9849 // be visible here. Since it is more specific than the generic ones
9850 // in ::testing::internal, it will be picked by the compiler in the
9851 // following statement - exactly what we want.
9852 PrintTo(value, os);
9853 }
9854
9855#ifdef _MSC_VER
9856# pragma warning(pop) // Restores the warning state.
9857#endif // _MSC_VER
9858};
9859
9860// UniversalPrintArray(begin, len, os) prints an array of 'len'
9861// elements, starting at address 'begin'.
9862template <typename T>
9863void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
9864 if (len == 0) {
9865 *os << "{}";
9866 } else {
9867 *os << "{ ";
9868 const size_t kThreshold = 18;
9869 const size_t kChunkSize = 8;
9870 // If the array has more than kThreshold elements, we'll have to
9871 // omit some details by printing only the first and the last
9872 // kChunkSize elements.
9873 // TODO(wan@google.com): let the user control the threshold using a flag.
9874 if (len <= kThreshold) {
9875 PrintRawArrayTo(begin, len, os);
9876 } else {
9877 PrintRawArrayTo(begin, kChunkSize, os);
9878 *os << ", ..., ";
9879 PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
9880 }
9881 *os << " }";
9882 }
9883}
9884// This overload prints a (const) char array compactly.
9885GTEST_API_ void UniversalPrintArray(
9886 const char* begin, size_t len, ::std::ostream* os);
9887
9888// This overload prints a (const) wchar_t array compactly.
9889GTEST_API_ void UniversalPrintArray(
9890 const wchar_t* begin, size_t len, ::std::ostream* os);
9891
9892// Implements printing an array type T[N].
9893template <typename T, size_t N>
9894class UniversalPrinter<T[N]> {
9895 public:
9896 // Prints the given array, omitting some elements when there are too
9897 // many.
9898 static void Print(const T (&a)[N], ::std::ostream* os) {
9899 UniversalPrintArray(a, N, os);
9900 }
9901};
9902
9903// Implements printing a reference type T&.
9904template <typename T>
9905class UniversalPrinter<T&> {
9906 public:
9907 // MSVC warns about adding const to a function type, so we want to
9908 // disable the warning.
9909#ifdef _MSC_VER
9910# pragma warning(push) // Saves the current warning state.
9911# pragma warning(disable:4180) // Temporarily disables warning 4180.
9912#endif // _MSC_VER
9913
9914 static void Print(const T& value, ::std::ostream* os) {
9915 // Prints the address of the value. We use reinterpret_cast here
9916 // as static_cast doesn't compile when T is a function type.
9917 *os << "@" << reinterpret_cast<const void*>(&value) << " ";
9918
9919 // Then prints the value itself.
9920 UniversalPrint(value, os);
9921 }
9922
9923#ifdef _MSC_VER
9924# pragma warning(pop) // Restores the warning state.
9925#endif // _MSC_VER
9926};
9927
9928// Prints a value tersely: for a reference type, the referenced value
9929// (but not the address) is printed; for a (const) char pointer, the
9930// NUL-terminated string (but not the pointer) is printed.
9931
9932template <typename T>
9933class UniversalTersePrinter {
9934 public:
9935 static void Print(const T& value, ::std::ostream* os) {
9936 UniversalPrint(value, os);
9937 }
9938};
9939template <typename T>
9940class UniversalTersePrinter<T&> {
9941 public:
9942 static void Print(const T& value, ::std::ostream* os) {
9943 UniversalPrint(value, os);
9944 }
9945};
9946template <typename T, size_t N>
9947class UniversalTersePrinter<T[N]> {
9948 public:
9949 static void Print(const T (&value)[N], ::std::ostream* os) {
9950 UniversalPrinter<T[N]>::Print(value, os);
9951 }
9952};
9953template <>
9954class UniversalTersePrinter<const char*> {
9955 public:
9956 static void Print(const char* str, ::std::ostream* os) {
9957 if (str == NULL) {
9958 *os << "NULL";
9959 } else {
9960 UniversalPrint(string(str), os);
9961 }
9962 }
9963};
9964template <>
9965class UniversalTersePrinter<char*> {
9966 public:
9967 static void Print(char* str, ::std::ostream* os) {
9968 UniversalTersePrinter<const char*>::Print(str, os);
9969 }
9970};
9971
9972#if GTEST_HAS_STD_WSTRING
9973template <>
9974class UniversalTersePrinter<const wchar_t*> {
9975 public:
9976 static void Print(const wchar_t* str, ::std::ostream* os) {
9977 if (str == NULL) {
9978 *os << "NULL";
9979 } else {
9980 UniversalPrint(::std::wstring(str), os);
9981 }
9982 }
9983};
9984#endif
9985
9986template <>
9987class UniversalTersePrinter<wchar_t*> {
9988 public:
9989 static void Print(wchar_t* str, ::std::ostream* os) {
9990 UniversalTersePrinter<const wchar_t*>::Print(str, os);
9991 }
9992};
9993
9994template <typename T>
9995void UniversalTersePrint(const T& value, ::std::ostream* os) {
9996 UniversalTersePrinter<T>::Print(value, os);
9997}
9998
9999// Prints a value using the type inferred by the compiler. The
10000// difference between this and UniversalTersePrint() is that for a
10001// (const) char pointer, this prints both the pointer and the
10002// NUL-terminated string.
10003template <typename T>
10004void UniversalPrint(const T& value, ::std::ostream* os) {
10005 // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
10006 // UniversalPrinter with T directly.
10007 typedef T T1;
10008 UniversalPrinter<T1>::Print(value, os);
10009}
10010
10011#if GTEST_HAS_TR1_TUPLE
10012typedef ::std::vector<string> Strings;
10013
10014// This helper template allows PrintTo() for tuples and
10015// UniversalTersePrintTupleFieldsToStrings() to be defined by
10016// induction on the number of tuple fields. The idea is that
10017// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
10018// fields in tuple t, and can be defined in terms of
10019// TuplePrefixPrinter<N - 1>.
10020
10021// The inductive case.
10022template <size_t N>
10023struct TuplePrefixPrinter {
10024 // Prints the first N fields of a tuple.
10025 template <typename Tuple>
10026 static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
10027 TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
10028 *os << ", ";
10029 UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
10030 ::Print(::std::tr1::get<N - 1>(t), os);
10031 }
10032
10033 // Tersely prints the first N fields of a tuple to a string vector,
10034 // one element for each field.
10035 template <typename Tuple>
10036 static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
10037 TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
10038 ::std::stringstream ss;
10039 UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
10040 strings->push_back(ss.str());
10041 }
10042};
10043
10044// Base cases.
10045template <>
10046struct TuplePrefixPrinter<0> {
10047 template <typename Tuple>
10048 static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
10049
10050 template <typename Tuple>
10051 static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
10052};
10053// We have to specialize the entire TuplePrefixPrinter<> class
10054// template here, even though the definition of
10055// TersePrintPrefixToStrings() is the same as the generic version, as
10056// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
10057// support specializing a method template of a class template.
10058template <>
10059struct TuplePrefixPrinter<1> {
10060 template <typename Tuple>
10061 static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
10062 UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
10063 Print(::std::tr1::get<0>(t), os);
10064 }
10065
10066 template <typename Tuple>
10067 static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
10068 ::std::stringstream ss;
10069 UniversalTersePrint(::std::tr1::get<0>(t), &ss);
10070 strings->push_back(ss.str());
10071 }
10072};
10073
10074// Helper function for printing a tuple. T must be instantiated with
10075// a tuple type.
10076template <typename T>
10077void PrintTupleTo(const T& t, ::std::ostream* os) {
10078 *os << "(";
10079 TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
10080 PrintPrefixTo(t, os);
10081 *os << ")";
10082}
10083
10084// Prints the fields of a tuple tersely to a string vector, one
10085// element for each field. See the comment before
10086// UniversalTersePrint() for how we define "tersely".
10087template <typename Tuple>
10088Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
10089 Strings result;
10090 TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
10091 TersePrintPrefixToStrings(value, &result);
10092 return result;
10093}
10094#endif // GTEST_HAS_TR1_TUPLE
10095
10096} // namespace internal
10097
10098template <typename T>
10099::std::string PrintToString(const T& value) {
10100 ::std::stringstream ss;
10101 internal::UniversalTersePrinter<T>::Print(value, &ss);
10102 return ss.str();
10103}
10104
10105} // namespace testing
10106
10107#endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10108
10109#if GTEST_HAS_PARAM_TEST
10110
10111namespace testing {
10112namespace internal {
10113
10114// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10115//
10116// Outputs a message explaining invalid registration of different
10117// fixture class for the same test case. This may happen when
10118// TEST_P macro is used to define two tests with the same name
10119// but in different namespaces.
10120GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
10121 const char* file, int line);
10122
10123template <typename> class ParamGeneratorInterface;
10124template <typename> class ParamGenerator;
10125
10126// Interface for iterating over elements provided by an implementation
10127// of ParamGeneratorInterface<T>.
10128template <typename T>
10129class ParamIteratorInterface {
10130 public:
10131 virtual ~ParamIteratorInterface() {}
10132 // A pointer to the base generator instance.
10133 // Used only for the purposes of iterator comparison
10134 // to make sure that two iterators belong to the same generator.
10135 virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
10136 // Advances iterator to point to the next element
10137 // provided by the generator. The caller is responsible
10138 // for not calling Advance() on an iterator equal to
10139 // BaseGenerator()->End().
10140 virtual void Advance() = 0;
10141 // Clones the iterator object. Used for implementing copy semantics
10142 // of ParamIterator<T>.
10143 virtual ParamIteratorInterface* Clone() const = 0;
10144 // Dereferences the current iterator and provides (read-only) access
10145 // to the pointed value. It is the caller's responsibility not to call
10146 // Current() on an iterator equal to BaseGenerator()->End().
10147 // Used for implementing ParamGenerator<T>::operator*().
10148 virtual const T* Current() const = 0;
10149 // Determines whether the given iterator and other point to the same
10150 // element in the sequence generated by the generator.
10151 // Used for implementing ParamGenerator<T>::operator==().
10152 virtual bool Equals(const ParamIteratorInterface& other) const = 0;
10153};
10154
10155// Class iterating over elements provided by an implementation of
10156// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
10157// and implements the const forward iterator concept.
10158template <typename T>
10159class ParamIterator {
10160 public:
10161 typedef T value_type;
10162 typedef const T& reference;
10163 typedef ptrdiff_t difference_type;
10164
10165 // ParamIterator assumes ownership of the impl_ pointer.
10166 ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
10167 ParamIterator& operator=(const ParamIterator& other) {
10168 if (this != &other)
10169 impl_.reset(other.impl_->Clone());
10170 return *this;
10171 }
10172
10173 const T& operator*() const { return *impl_->Current(); }
10174 const T* operator->() const { return impl_->Current(); }
10175 // Prefix version of operator++.
10176 ParamIterator& operator++() {
10177 impl_->Advance();
10178 return *this;
10179 }
10180 // Postfix version of operator++.
10181 ParamIterator operator++(int /*unused*/) {
10182 ParamIteratorInterface<T>* clone = impl_->Clone();
10183 impl_->Advance();
10184 return ParamIterator(clone);
10185 }
10186 bool operator==(const ParamIterator& other) const {
10187 return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
10188 }
10189 bool operator!=(const ParamIterator& other) const {
10190 return !(*this == other);
10191 }
10192
10193 private:
10194 friend class ParamGenerator<T>;
10195 explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
10196 scoped_ptr<ParamIteratorInterface<T> > impl_;
10197};
10198
10199// ParamGeneratorInterface<T> is the binary interface to access generators
10200// defined in other translation units.
10201template <typename T>
10202class ParamGeneratorInterface {
10203 public:
10204 typedef T ParamType;
10205
10206 virtual ~ParamGeneratorInterface() {}
10207
10208 // Generator interface definition
10209 virtual ParamIteratorInterface<T>* Begin() const = 0;
10210 virtual ParamIteratorInterface<T>* End() const = 0;
10211};
10212
10213// Wraps ParamGeneratorInterface<T> and provides general generator syntax
10214// compatible with the STL Container concept.
10215// This class implements copy initialization semantics and the contained
10216// ParamGeneratorInterface<T> instance is shared among all copies
10217// of the original object. This is possible because that instance is immutable.
10218template<typename T>
10219class ParamGenerator {
10220 public:
10221 typedef ParamIterator<T> iterator;
10222
10223 explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
10224 ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
10225
10226 ParamGenerator& operator=(const ParamGenerator& other) {
10227 impl_ = other.impl_;
10228 return *this;
10229 }
10230
10231 iterator begin() const { return iterator(impl_->Begin()); }
10232 iterator end() const { return iterator(impl_->End()); }
10233
10234 private:
10235 linked_ptr<const ParamGeneratorInterface<T> > impl_;
10236};
10237
10238// Generates values from a range of two comparable values. Can be used to
10239// generate sequences of user-defined types that implement operator+() and
10240// operator<().
10241// This class is used in the Range() function.
10242template <typename T, typename IncrementT>
10243class RangeGenerator : public ParamGeneratorInterface<T> {
10244 public:
10245 RangeGenerator(T begin, T end, IncrementT step)
10246 : begin_(begin), end_(end),
10247 step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
10248 virtual ~RangeGenerator() {}
10249
10250 virtual ParamIteratorInterface<T>* Begin() const {
10251 return new Iterator(this, begin_, 0, step_);
10252 }
10253 virtual ParamIteratorInterface<T>* End() const {
10254 return new Iterator(this, end_, end_index_, step_);
10255 }
10256
10257 private:
10258 class Iterator : public ParamIteratorInterface<T> {
10259 public:
10260 Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
10261 IncrementT step)
10262 : base_(base), value_(value), index_(index), step_(step) {}
10263 virtual ~Iterator() {}
10264
10265 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10266 return base_;
10267 }
10268 virtual void Advance() {
10269 value_ = value_ + step_;
10270 index_++;
10271 }
10272 virtual ParamIteratorInterface<T>* Clone() const {
10273 return new Iterator(*this);
10274 }
10275 virtual const T* Current() const { return &value_; }
10276 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10277 // Having the same base generator guarantees that the other
10278 // iterator is of the same type and we can downcast.
10279 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10280 << "The program attempted to compare iterators "
10281 << "from different generators." << std::endl;
10282 const int other_index =
10283 CheckedDowncastToActualType<const Iterator>(&other)->index_;
10284 return index_ == other_index;
10285 }
10286
10287 private:
10288 Iterator(const Iterator& other)
10289 : ParamIteratorInterface<T>(),
10290 base_(other.base_), value_(other.value_), index_(other.index_),
10291 step_(other.step_) {}
10292
10293 // No implementation - assignment is unsupported.
10294 void operator=(const Iterator& other);
10295
10296 const ParamGeneratorInterface<T>* const base_;
10297 T value_;
10298 int index_;
10299 const IncrementT step_;
10300 }; // class RangeGenerator::Iterator
10301
10302 static int CalculateEndIndex(const T& begin,
10303 const T& end,
10304 const IncrementT& step) {
10305 int end_index = 0;
10306 for (T i = begin; i < end; i = i + step)
10307 end_index++;
10308 return end_index;
10309 }
10310
10311 // No implementation - assignment is unsupported.
10312 void operator=(const RangeGenerator& other);
10313
10314 const T begin_;
10315 const T end_;
10316 const IncrementT step_;
10317 // The index for the end() iterator. All the elements in the generated
10318 // sequence are indexed (0-based) to aid iterator comparison.
10319 const int end_index_;
10320}; // class RangeGenerator
10321
10322
10323// Generates values from a pair of STL-style iterators. Used in the
10324// ValuesIn() function. The elements are copied from the source range
10325// since the source can be located on the stack, and the generator
10326// is likely to persist beyond that stack frame.
10327template <typename T>
10328class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
10329 public:
10330 template <typename ForwardIterator>
10331 ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
10332 : container_(begin, end) {}
10333 virtual ~ValuesInIteratorRangeGenerator() {}
10334
10335 virtual ParamIteratorInterface<T>* Begin() const {
10336 return new Iterator(this, container_.begin());
10337 }
10338 virtual ParamIteratorInterface<T>* End() const {
10339 return new Iterator(this, container_.end());
10340 }
10341
10342 private:
10343 typedef typename ::std::vector<T> ContainerType;
10344
10345 class Iterator : public ParamIteratorInterface<T> {
10346 public:
10347 Iterator(const ParamGeneratorInterface<T>* base,
10348 typename ContainerType::const_iterator iterator)
10349 : base_(base), iterator_(iterator) {}
10350 virtual ~Iterator() {}
10351
10352 virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10353 return base_;
10354 }
10355 virtual void Advance() {
10356 ++iterator_;
10357 value_.reset();
10358 }
10359 virtual ParamIteratorInterface<T>* Clone() const {
10360 return new Iterator(*this);
10361 }
10362 // We need to use cached value referenced by iterator_ because *iterator_
10363 // can return a temporary object (and of type other then T), so just
10364 // having "return &*iterator_;" doesn't work.
10365 // value_ is updated here and not in Advance() because Advance()
10366 // can advance iterator_ beyond the end of the range, and we cannot
10367 // detect that fact. The client code, on the other hand, is
10368 // responsible for not calling Current() on an out-of-range iterator.
10369 virtual const T* Current() const {
10370 if (value_.get() == NULL)
10371 value_.reset(new T(*iterator_));
10372 return value_.get();
10373 }
10374 virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10375 // Having the same base generator guarantees that the other
10376 // iterator is of the same type and we can downcast.
10377 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10378 << "The program attempted to compare iterators "
10379 << "from different generators." << std::endl;
10380 return iterator_ ==
10381 CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
10382 }
10383
10384 private:
10385 Iterator(const Iterator& other)
10386 // The explicit constructor call suppresses a false warning
10387 // emitted by gcc when supplied with the -Wextra option.
10388 : ParamIteratorInterface<T>(),
10389 base_(other.base_),
10390 iterator_(other.iterator_) {}
10391
10392 const ParamGeneratorInterface<T>* const base_;
10393 typename ContainerType::const_iterator iterator_;
10394 // A cached value of *iterator_. We keep it here to allow access by
10395 // pointer in the wrapping iterator's operator->().
10396 // value_ needs to be mutable to be accessed in Current().
10397 // Use of scoped_ptr helps manage cached value's lifetime,
10398 // which is bound by the lifespan of the iterator itself.
10399 mutable scoped_ptr<const T> value_;
10400 }; // class ValuesInIteratorRangeGenerator::Iterator
10401
10402 // No implementation - assignment is unsupported.
10403 void operator=(const ValuesInIteratorRangeGenerator& other);
10404
10405 const ContainerType container_;
10406}; // class ValuesInIteratorRangeGenerator
10407
10408// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10409//
10410// Stores a parameter value and later creates tests parameterized with that
10411// value.
10412template <class TestClass>
10413class ParameterizedTestFactory : public TestFactoryBase {
10414 public:
10415 typedef typename TestClass::ParamType ParamType;
10416 explicit ParameterizedTestFactory(ParamType parameter) :
10417 parameter_(parameter) {}
10418 virtual Test* CreateTest() {
10419 TestClass::SetParam(&parameter_);
10420 return new TestClass();
10421 }
10422
10423 private:
10424 const ParamType parameter_;
10425
10426 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
10427};
10428
10429// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10430//
10431// TestMetaFactoryBase is a base class for meta-factories that create
10432// test factories for passing into MakeAndRegisterTestInfo function.
10433template <class ParamType>
10434class TestMetaFactoryBase {
10435 public:
10436 virtual ~TestMetaFactoryBase() {}
10437
10438 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
10439};
10440
10441// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10442//
10443// TestMetaFactory creates test factories for passing into
10444// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
10445// ownership of test factory pointer, same factory object cannot be passed
10446// into that method twice. But ParameterizedTestCaseInfo is going to call
10447// it for each Test/Parameter value combination. Thus it needs meta factory
10448// creator class.
10449template <class TestCase>
10450class TestMetaFactory
10451 : public TestMetaFactoryBase<typename TestCase::ParamType> {
10452 public:
10453 typedef typename TestCase::ParamType ParamType;
10454
10455 TestMetaFactory() {}
10456
10457 virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
10458 return new ParameterizedTestFactory<TestCase>(parameter);
10459 }
10460
10461 private:
10462 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
10463};
10464
10465// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10466//
10467// ParameterizedTestCaseInfoBase is a generic interface
10468// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
10469// accumulates test information provided by TEST_P macro invocations
10470// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
10471// and uses that information to register all resulting test instances
10472// in RegisterTests method. The ParameterizeTestCaseRegistry class holds
10473// a collection of pointers to the ParameterizedTestCaseInfo objects
10474// and calls RegisterTests() on each of them when asked.
10475class ParameterizedTestCaseInfoBase {
10476 public:
10477 virtual ~ParameterizedTestCaseInfoBase() {}
10478
10479 // Base part of test case name for display purposes.
10480 virtual const string& GetTestCaseName() const = 0;
10481 // Test case id to verify identity.
10482 virtual TypeId GetTestCaseTypeId() const = 0;
10483 // UnitTest class invokes this method to register tests in this
10484 // test case right before running them in RUN_ALL_TESTS macro.
10485 // This method should not be called more then once on any single
10486 // instance of a ParameterizedTestCaseInfoBase derived class.
10487 virtual void RegisterTests() = 0;
10488
10489 protected:
10490 ParameterizedTestCaseInfoBase() {}
10491
10492 private:
10493 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
10494};
10495
10496// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10497//
10498// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
10499// macro invocations for a particular test case and generators
10500// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
10501// test case. It registers tests with all values generated by all
10502// generators when asked.
10503template <class TestCase>
10504class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
10505 public:
10506 // ParamType and GeneratorCreationFunc are private types but are required
10507 // for declarations of public methods AddTestPattern() and
10508 // AddTestCaseInstantiation().
10509 typedef typename TestCase::ParamType ParamType;
10510 // A function that returns an instance of appropriate generator type.
10511 typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
10512
10513 explicit ParameterizedTestCaseInfo(const char* name)
10514 : test_case_name_(name) {}
10515
10516 // Test case base name for display purposes.
10517 virtual const string& GetTestCaseName() const { return test_case_name_; }
10518 // Test case id to verify identity.
10519 virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
10520 // TEST_P macro uses AddTestPattern() to record information
10521 // about a single test in a LocalTestInfo structure.
10522 // test_case_name is the base name of the test case (without invocation
10523 // prefix). test_base_name is the name of an individual test without
10524 // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
10525 // test case base name and DoBar is test base name.
10526 void AddTestPattern(const char* test_case_name,
10527 const char* test_base_name,
10528 TestMetaFactoryBase<ParamType>* meta_factory) {
10529 tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
10530 test_base_name,
10531 meta_factory)));
10532 }
10533 // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
10534 // about a generator.
10535 int AddTestCaseInstantiation(const string& instantiation_name,
10536 GeneratorCreationFunc* func,
10537 const char* /* file */,
10538 int /* line */) {
10539 instantiations_.push_back(::std::make_pair(instantiation_name, func));
10540 return 0; // Return value used only to run this method in namespace scope.
10541 }
10542 // UnitTest class invokes this method to register tests in this test case
10543 // test cases right before running tests in RUN_ALL_TESTS macro.
10544 // This method should not be called more then once on any single
10545 // instance of a ParameterizedTestCaseInfoBase derived class.
10546 // UnitTest has a guard to prevent from calling this method more then once.
10547 virtual void RegisterTests() {
10548 for (typename TestInfoContainer::iterator test_it = tests_.begin();
10549 test_it != tests_.end(); ++test_it) {
10550 linked_ptr<TestInfo> test_info = *test_it;
10551 for (typename InstantiationContainer::iterator gen_it =
10552 instantiations_.begin(); gen_it != instantiations_.end();
10553 ++gen_it) {
10554 const string& instantiation_name = gen_it->first;
10555 ParamGenerator<ParamType> generator((*gen_it->second)());
10556
10557 string test_case_name;
10558 if ( !instantiation_name.empty() )
10559 test_case_name = instantiation_name + "/";
10560 test_case_name += test_info->test_case_base_name;
10561
10562 int i = 0;
10563 for (typename ParamGenerator<ParamType>::iterator param_it =
10564 generator.begin();
10565 param_it != generator.end(); ++param_it, ++i) {
10566 Message test_name_stream;
10567 test_name_stream << test_info->test_base_name << "/" << i;
10568 MakeAndRegisterTestInfo(
10569 test_case_name.c_str(),
10570 test_name_stream.GetString().c_str(),
10571 NULL, // No type parameter.
10572 PrintToString(*param_it).c_str(),
10573 GetTestCaseTypeId(),
10574 TestCase::SetUpTestCase,
10575 TestCase::TearDownTestCase,
10576 test_info->test_meta_factory->CreateTestFactory(*param_it));
10577 } // for param_it
10578 } // for gen_it
10579 } // for test_it
10580 } // RegisterTests
10581
10582 private:
10583 // LocalTestInfo structure keeps information about a single test registered
10584 // with TEST_P macro.
10585 struct TestInfo {
10586 TestInfo(const char* a_test_case_base_name,
10587 const char* a_test_base_name,
10588 TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
10589 test_case_base_name(a_test_case_base_name),
10590 test_base_name(a_test_base_name),
10591 test_meta_factory(a_test_meta_factory) {}
10592
10593 const string test_case_base_name;
10594 const string test_base_name;
10595 const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
10596 };
10597 typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
10598 // Keeps pairs of <Instantiation name, Sequence generator creation function>
10599 // received from INSTANTIATE_TEST_CASE_P macros.
10600 typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
10601 InstantiationContainer;
10602
10603 const string test_case_name_;
10604 TestInfoContainer tests_;
10605 InstantiationContainer instantiations_;
10606
10607 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
10608}; // class ParameterizedTestCaseInfo
10609
10610// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10611//
10612// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
10613// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
10614// macros use it to locate their corresponding ParameterizedTestCaseInfo
10615// descriptors.
10616class ParameterizedTestCaseRegistry {
10617 public:
10618 ParameterizedTestCaseRegistry() {}
10619 ~ParameterizedTestCaseRegistry() {
10620 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10621 it != test_case_infos_.end(); ++it) {
10622 delete *it;
10623 }
10624 }
10625
10626 // Looks up or creates and returns a structure containing information about
10627 // tests and instantiations of a particular test case.
10628 template <class TestCase>
10629 ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
10630 const char* test_case_name,
10631 const char* file,
10632 int line) {
10633 ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
10634 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10635 it != test_case_infos_.end(); ++it) {
10636 if ((*it)->GetTestCaseName() == test_case_name) {
10637 if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
10638 // Complain about incorrect usage of Google Test facilities
10639 // and terminate the program since we cannot guaranty correct
10640 // test case setup and tear-down in this case.
10641 ReportInvalidTestCaseType(test_case_name, file, line);
10642 posix::Abort();
10643 } else {
10644 // At this point we are sure that the object we found is of the same
10645 // type we are looking for, so we downcast it to that type
10646 // without further checks.
10647 typed_test_info = CheckedDowncastToActualType<
10648 ParameterizedTestCaseInfo<TestCase> >(*it);
10649 }
10650 break;
10651 }
10652 }
10653 if (typed_test_info == NULL) {
10654 typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
10655 test_case_infos_.push_back(typed_test_info);
10656 }
10657 return typed_test_info;
10658 }
10659 void RegisterTests() {
10660 for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10661 it != test_case_infos_.end(); ++it) {
10662 (*it)->RegisterTests();
10663 }
10664 }
10665
10666 private:
10667 typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
10668
10669 TestCaseInfoContainer test_case_infos_;
10670
10671 GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
10672};
10673
10674} // namespace internal
10675} // namespace testing
10676
10677#endif // GTEST_HAS_PARAM_TEST
10678
10679#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10680// This file was GENERATED by command:
10681// pump.py gtest-param-util-generated.h.pump
10682// DO NOT EDIT BY HAND!!!
10683
10684// Copyright 2008 Google Inc.
10685// All Rights Reserved.
10686//
10687// Redistribution and use in source and binary forms, with or without
10688// modification, are permitted provided that the following conditions are
10689// met:
10690//
10691// * Redistributions of source code must retain the above copyright
10692// notice, this list of conditions and the following disclaimer.
10693// * Redistributions in binary form must reproduce the above
10694// copyright notice, this list of conditions and the following disclaimer
10695// in the documentation and/or other materials provided with the
10696// distribution.
10697// * Neither the name of Google Inc. nor the names of its
10698// contributors may be used to endorse or promote products derived from
10699// this software without specific prior written permission.
10700//
10701// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10702// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10703// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10704// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10705// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10706// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10707// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10708// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10709// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10710// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10711// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10712//
10713// Author: vladl@google.com (Vlad Losev)
10714
10715// Type and function utilities for implementing parameterized tests.
10716// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
10717//
10718// Currently Google Test supports at most 50 arguments in Values,
10719// and at most 10 arguments in Combine. Please contact
10720// googletestframework@googlegroups.com if you need more.
10721// Please note that the number of arguments to Combine is limited
10722// by the maximum arity of the implementation of tr1::tuple which is
10723// currently set at 10.
10724
10725#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10726#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10727
10728// scripts/fuse_gtest.py depends on gtest's own header being #included
10729// *unconditionally*. Therefore these #includes cannot be moved
10730// inside #if GTEST_HAS_PARAM_TEST.
10731
10732#if GTEST_HAS_PARAM_TEST
10733
10734namespace testing {
10735
10736// Forward declarations of ValuesIn(), which is implemented in
10737// include/gtest/gtest-param-test.h.
10738template <typename ForwardIterator>
10739internal::ParamGenerator<
10740 typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
10741ValuesIn(ForwardIterator begin, ForwardIterator end);
10742
10743template <typename T, size_t N>
10744internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
10745
10746template <class Container>
10747internal::ParamGenerator<typename Container::value_type> ValuesIn(
10748 const Container& container);
10749
10750namespace internal {
10751
10752// Used in the Values() function to provide polymorphic capabilities.
10753template <typename T1>
10754class ValueArray1 {
10755 public:
10756 explicit ValueArray1(T1 v1) : v1_(v1) {}
10757
10758 template <typename T>
10759 operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
10760
10761 private:
10762 // No implementation - assignment is unsupported.
10763 void operator=(const ValueArray1& other);
10764
10765 const T1 v1_;
10766};
10767
10768template <typename T1, typename T2>
10769class ValueArray2 {
10770 public:
10771 ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
10772
10773 template <typename T>
10774 operator ParamGenerator<T>() const {
10775 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
10776 return ValuesIn(array);
10777 }
10778
10779 private:
10780 // No implementation - assignment is unsupported.
10781 void operator=(const ValueArray2& other);
10782
10783 const T1 v1_;
10784 const T2 v2_;
10785};
10786
10787template <typename T1, typename T2, typename T3>
10788class ValueArray3 {
10789 public:
10790 ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
10791
10792 template <typename T>
10793 operator ParamGenerator<T>() const {
10794 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10795 static_cast<T>(v3_)};
10796 return ValuesIn(array);
10797 }
10798
10799 private:
10800 // No implementation - assignment is unsupported.
10801 void operator=(const ValueArray3& other);
10802
10803 const T1 v1_;
10804 const T2 v2_;
10805 const T3 v3_;
10806};
10807
10808template <typename T1, typename T2, typename T3, typename T4>
10809class ValueArray4 {
10810 public:
10811 ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
10812 v4_(v4) {}
10813
10814 template <typename T>
10815 operator ParamGenerator<T>() const {
10816 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10817 static_cast<T>(v3_), static_cast<T>(v4_)};
10818 return ValuesIn(array);
10819 }
10820
10821 private:
10822 // No implementation - assignment is unsupported.
10823 void operator=(const ValueArray4& other);
10824
10825 const T1 v1_;
10826 const T2 v2_;
10827 const T3 v3_;
10828 const T4 v4_;
10829};
10830
10831template <typename T1, typename T2, typename T3, typename T4, typename T5>
10832class ValueArray5 {
10833 public:
10834 ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
10835 v4_(v4), v5_(v5) {}
10836
10837 template <typename T>
10838 operator ParamGenerator<T>() const {
10839 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10840 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
10841 return ValuesIn(array);
10842 }
10843
10844 private:
10845 // No implementation - assignment is unsupported.
10846 void operator=(const ValueArray5& other);
10847
10848 const T1 v1_;
10849 const T2 v2_;
10850 const T3 v3_;
10851 const T4 v4_;
10852 const T5 v5_;
10853};
10854
10855template <typename T1, typename T2, typename T3, typename T4, typename T5,
10856 typename T6>
10857class ValueArray6 {
10858 public:
10859 ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
10860 v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
10861
10862 template <typename T>
10863 operator ParamGenerator<T>() const {
10864 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10865 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10866 static_cast<T>(v6_)};
10867 return ValuesIn(array);
10868 }
10869
10870 private:
10871 // No implementation - assignment is unsupported.
10872 void operator=(const ValueArray6& other);
10873
10874 const T1 v1_;
10875 const T2 v2_;
10876 const T3 v3_;
10877 const T4 v4_;
10878 const T5 v5_;
10879 const T6 v6_;
10880};
10881
10882template <typename T1, typename T2, typename T3, typename T4, typename T5,
10883 typename T6, typename T7>
10884class ValueArray7 {
10885 public:
10886 ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
10887 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
10888
10889 template <typename T>
10890 operator ParamGenerator<T>() const {
10891 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10892 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10893 static_cast<T>(v6_), static_cast<T>(v7_)};
10894 return ValuesIn(array);
10895 }
10896
10897 private:
10898 // No implementation - assignment is unsupported.
10899 void operator=(const ValueArray7& other);
10900
10901 const T1 v1_;
10902 const T2 v2_;
10903 const T3 v3_;
10904 const T4 v4_;
10905 const T5 v5_;
10906 const T6 v6_;
10907 const T7 v7_;
10908};
10909
10910template <typename T1, typename T2, typename T3, typename T4, typename T5,
10911 typename T6, typename T7, typename T8>
10912class ValueArray8 {
10913 public:
10914 ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
10915 T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10916 v8_(v8) {}
10917
10918 template <typename T>
10919 operator ParamGenerator<T>() const {
10920 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10921 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10922 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
10923 return ValuesIn(array);
10924 }
10925
10926 private:
10927 // No implementation - assignment is unsupported.
10928 void operator=(const ValueArray8& other);
10929
10930 const T1 v1_;
10931 const T2 v2_;
10932 const T3 v3_;
10933 const T4 v4_;
10934 const T5 v5_;
10935 const T6 v6_;
10936 const T7 v7_;
10937 const T8 v8_;
10938};
10939
10940template <typename T1, typename T2, typename T3, typename T4, typename T5,
10941 typename T6, typename T7, typename T8, typename T9>
10942class ValueArray9 {
10943 public:
10944 ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
10945 T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10946 v8_(v8), v9_(v9) {}
10947
10948 template <typename T>
10949 operator ParamGenerator<T>() const {
10950 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10951 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10952 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10953 static_cast<T>(v9_)};
10954 return ValuesIn(array);
10955 }
10956
10957 private:
10958 // No implementation - assignment is unsupported.
10959 void operator=(const ValueArray9& other);
10960
10961 const T1 v1_;
10962 const T2 v2_;
10963 const T3 v3_;
10964 const T4 v4_;
10965 const T5 v5_;
10966 const T6 v6_;
10967 const T7 v7_;
10968 const T8 v8_;
10969 const T9 v9_;
10970};
10971
10972template <typename T1, typename T2, typename T3, typename T4, typename T5,
10973 typename T6, typename T7, typename T8, typename T9, typename T10>
10974class ValueArray10 {
10975 public:
10976 ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10977 T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10978 v8_(v8), v9_(v9), v10_(v10) {}
10979
10980 template <typename T>
10981 operator ParamGenerator<T>() const {
10982 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10983 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10984 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10985 static_cast<T>(v9_), static_cast<T>(v10_)};
10986 return ValuesIn(array);
10987 }
10988
10989 private:
10990 // No implementation - assignment is unsupported.
10991 void operator=(const ValueArray10& other);
10992
10993 const T1 v1_;
10994 const T2 v2_;
10995 const T3 v3_;
10996 const T4 v4_;
10997 const T5 v5_;
10998 const T6 v6_;
10999 const T7 v7_;
11000 const T8 v8_;
11001 const T9 v9_;
11002 const T10 v10_;
11003};
11004
11005template <typename T1, typename T2, typename T3, typename T4, typename T5,
11006 typename T6, typename T7, typename T8, typename T9, typename T10,
11007 typename T11>
11008class ValueArray11 {
11009 public:
11010 ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11011 T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11012 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
11013
11014 template <typename T>
11015 operator ParamGenerator<T>() const {
11016 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11017 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11018 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11019 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
11020 return ValuesIn(array);
11021 }
11022
11023 private:
11024 // No implementation - assignment is unsupported.
11025 void operator=(const ValueArray11& other);
11026
11027 const T1 v1_;
11028 const T2 v2_;
11029 const T3 v3_;
11030 const T4 v4_;
11031 const T5 v5_;
11032 const T6 v6_;
11033 const T7 v7_;
11034 const T8 v8_;
11035 const T9 v9_;
11036 const T10 v10_;
11037 const T11 v11_;
11038};
11039
11040template <typename T1, typename T2, typename T3, typename T4, typename T5,
11041 typename T6, typename T7, typename T8, typename T9, typename T10,
11042 typename T11, typename T12>
11043class ValueArray12 {
11044 public:
11045 ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11046 T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11047 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
11048
11049 template <typename T>
11050 operator ParamGenerator<T>() const {
11051 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11052 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11053 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11054 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11055 static_cast<T>(v12_)};
11056 return ValuesIn(array);
11057 }
11058
11059 private:
11060 // No implementation - assignment is unsupported.
11061 void operator=(const ValueArray12& other);
11062
11063 const T1 v1_;
11064 const T2 v2_;
11065 const T3 v3_;
11066 const T4 v4_;
11067 const T5 v5_;
11068 const T6 v6_;
11069 const T7 v7_;
11070 const T8 v8_;
11071 const T9 v9_;
11072 const T10 v10_;
11073 const T11 v11_;
11074 const T12 v12_;
11075};
11076
11077template <typename T1, typename T2, typename T3, typename T4, typename T5,
11078 typename T6, typename T7, typename T8, typename T9, typename T10,
11079 typename T11, typename T12, typename T13>
11080class ValueArray13 {
11081 public:
11082 ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11083 T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11084 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11085 v12_(v12), v13_(v13) {}
11086
11087 template <typename T>
11088 operator ParamGenerator<T>() const {
11089 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11090 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11091 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11092 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11093 static_cast<T>(v12_), static_cast<T>(v13_)};
11094 return ValuesIn(array);
11095 }
11096
11097 private:
11098 // No implementation - assignment is unsupported.
11099 void operator=(const ValueArray13& other);
11100
11101 const T1 v1_;
11102 const T2 v2_;
11103 const T3 v3_;
11104 const T4 v4_;
11105 const T5 v5_;
11106 const T6 v6_;
11107 const T7 v7_;
11108 const T8 v8_;
11109 const T9 v9_;
11110 const T10 v10_;
11111 const T11 v11_;
11112 const T12 v12_;
11113 const T13 v13_;
11114};
11115
11116template <typename T1, typename T2, typename T3, typename T4, typename T5,
11117 typename T6, typename T7, typename T8, typename T9, typename T10,
11118 typename T11, typename T12, typename T13, typename T14>
11119class ValueArray14 {
11120 public:
11121 ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11122 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
11123 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11124 v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
11125
11126 template <typename T>
11127 operator ParamGenerator<T>() const {
11128 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11129 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11130 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11131 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11132 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
11133 return ValuesIn(array);
11134 }
11135
11136 private:
11137 // No implementation - assignment is unsupported.
11138 void operator=(const ValueArray14& other);
11139
11140 const T1 v1_;
11141 const T2 v2_;
11142 const T3 v3_;
11143 const T4 v4_;
11144 const T5 v5_;
11145 const T6 v6_;
11146 const T7 v7_;
11147 const T8 v8_;
11148 const T9 v9_;
11149 const T10 v10_;
11150 const T11 v11_;
11151 const T12 v12_;
11152 const T13 v13_;
11153 const T14 v14_;
11154};
11155
11156template <typename T1, typename T2, typename T3, typename T4, typename T5,
11157 typename T6, typename T7, typename T8, typename T9, typename T10,
11158 typename T11, typename T12, typename T13, typename T14, typename T15>
11159class ValueArray15 {
11160 public:
11161 ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11162 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
11163 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11164 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
11165
11166 template <typename T>
11167 operator ParamGenerator<T>() const {
11168 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11169 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11170 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11171 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11172 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11173 static_cast<T>(v15_)};
11174 return ValuesIn(array);
11175 }
11176
11177 private:
11178 // No implementation - assignment is unsupported.
11179 void operator=(const ValueArray15& other);
11180
11181 const T1 v1_;
11182 const T2 v2_;
11183 const T3 v3_;
11184 const T4 v4_;
11185 const T5 v5_;
11186 const T6 v6_;
11187 const T7 v7_;
11188 const T8 v8_;
11189 const T9 v9_;
11190 const T10 v10_;
11191 const T11 v11_;
11192 const T12 v12_;
11193 const T13 v13_;
11194 const T14 v14_;
11195 const T15 v15_;
11196};
11197
11198template <typename T1, typename T2, typename T3, typename T4, typename T5,
11199 typename T6, typename T7, typename T8, typename T9, typename T10,
11200 typename T11, typename T12, typename T13, typename T14, typename T15,
11201 typename T16>
11202class ValueArray16 {
11203 public:
11204 ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11205 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
11206 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11207 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11208 v16_(v16) {}
11209
11210 template <typename T>
11211 operator ParamGenerator<T>() const {
11212 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11213 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11214 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11215 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11216 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11217 static_cast<T>(v15_), static_cast<T>(v16_)};
11218 return ValuesIn(array);
11219 }
11220
11221 private:
11222 // No implementation - assignment is unsupported.
11223 void operator=(const ValueArray16& other);
11224
11225 const T1 v1_;
11226 const T2 v2_;
11227 const T3 v3_;
11228 const T4 v4_;
11229 const T5 v5_;
11230 const T6 v6_;
11231 const T7 v7_;
11232 const T8 v8_;
11233 const T9 v9_;
11234 const T10 v10_;
11235 const T11 v11_;
11236 const T12 v12_;
11237 const T13 v13_;
11238 const T14 v14_;
11239 const T15 v15_;
11240 const T16 v16_;
11241};
11242
11243template <typename T1, typename T2, typename T3, typename T4, typename T5,
11244 typename T6, typename T7, typename T8, typename T9, typename T10,
11245 typename T11, typename T12, typename T13, typename T14, typename T15,
11246 typename T16, typename T17>
11247class ValueArray17 {
11248 public:
11249 ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11250 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
11251 T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11252 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11253 v15_(v15), v16_(v16), v17_(v17) {}
11254
11255 template <typename T>
11256 operator ParamGenerator<T>() const {
11257 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11258 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11259 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11260 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11261 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11262 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
11263 return ValuesIn(array);
11264 }
11265
11266 private:
11267 // No implementation - assignment is unsupported.
11268 void operator=(const ValueArray17& other);
11269
11270 const T1 v1_;
11271 const T2 v2_;
11272 const T3 v3_;
11273 const T4 v4_;
11274 const T5 v5_;
11275 const T6 v6_;
11276 const T7 v7_;
11277 const T8 v8_;
11278 const T9 v9_;
11279 const T10 v10_;
11280 const T11 v11_;
11281 const T12 v12_;
11282 const T13 v13_;
11283 const T14 v14_;
11284 const T15 v15_;
11285 const T16 v16_;
11286 const T17 v17_;
11287};
11288
11289template <typename T1, typename T2, typename T3, typename T4, typename T5,
11290 typename T6, typename T7, typename T8, typename T9, typename T10,
11291 typename T11, typename T12, typename T13, typename T14, typename T15,
11292 typename T16, typename T17, typename T18>
11293class ValueArray18 {
11294 public:
11295 ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11296 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11297 T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11298 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11299 v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
11300
11301 template <typename T>
11302 operator ParamGenerator<T>() const {
11303 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11304 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11305 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11306 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11307 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11308 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11309 static_cast<T>(v18_)};
11310 return ValuesIn(array);
11311 }
11312
11313 private:
11314 // No implementation - assignment is unsupported.
11315 void operator=(const ValueArray18& other);
11316
11317 const T1 v1_;
11318 const T2 v2_;
11319 const T3 v3_;
11320 const T4 v4_;
11321 const T5 v5_;
11322 const T6 v6_;
11323 const T7 v7_;
11324 const T8 v8_;
11325 const T9 v9_;
11326 const T10 v10_;
11327 const T11 v11_;
11328 const T12 v12_;
11329 const T13 v13_;
11330 const T14 v14_;
11331 const T15 v15_;
11332 const T16 v16_;
11333 const T17 v17_;
11334 const T18 v18_;
11335};
11336
11337template <typename T1, typename T2, typename T3, typename T4, typename T5,
11338 typename T6, typename T7, typename T8, typename T9, typename T10,
11339 typename T11, typename T12, typename T13, typename T14, typename T15,
11340 typename T16, typename T17, typename T18, typename T19>
11341class ValueArray19 {
11342 public:
11343 ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11344 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11345 T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11346 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11347 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
11348
11349 template <typename T>
11350 operator ParamGenerator<T>() const {
11351 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11352 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11353 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11354 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11355 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11356 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11357 static_cast<T>(v18_), static_cast<T>(v19_)};
11358 return ValuesIn(array);
11359 }
11360
11361 private:
11362 // No implementation - assignment is unsupported.
11363 void operator=(const ValueArray19& other);
11364
11365 const T1 v1_;
11366 const T2 v2_;
11367 const T3 v3_;
11368 const T4 v4_;
11369 const T5 v5_;
11370 const T6 v6_;
11371 const T7 v7_;
11372 const T8 v8_;
11373 const T9 v9_;
11374 const T10 v10_;
11375 const T11 v11_;
11376 const T12 v12_;
11377 const T13 v13_;
11378 const T14 v14_;
11379 const T15 v15_;
11380 const T16 v16_;
11381 const T17 v17_;
11382 const T18 v18_;
11383 const T19 v19_;
11384};
11385
11386template <typename T1, typename T2, typename T3, typename T4, typename T5,
11387 typename T6, typename T7, typename T8, typename T9, typename T10,
11388 typename T11, typename T12, typename T13, typename T14, typename T15,
11389 typename T16, typename T17, typename T18, typename T19, typename T20>
11390class ValueArray20 {
11391 public:
11392 ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11393 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11394 T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11395 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11396 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11397 v19_(v19), v20_(v20) {}
11398
11399 template <typename T>
11400 operator ParamGenerator<T>() const {
11401 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11402 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11403 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11404 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11405 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11406 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11407 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
11408 return ValuesIn(array);
11409 }
11410
11411 private:
11412 // No implementation - assignment is unsupported.
11413 void operator=(const ValueArray20& other);
11414
11415 const T1 v1_;
11416 const T2 v2_;
11417 const T3 v3_;
11418 const T4 v4_;
11419 const T5 v5_;
11420 const T6 v6_;
11421 const T7 v7_;
11422 const T8 v8_;
11423 const T9 v9_;
11424 const T10 v10_;
11425 const T11 v11_;
11426 const T12 v12_;
11427 const T13 v13_;
11428 const T14 v14_;
11429 const T15 v15_;
11430 const T16 v16_;
11431 const T17 v17_;
11432 const T18 v18_;
11433 const T19 v19_;
11434 const T20 v20_;
11435};
11436
11437template <typename T1, typename T2, typename T3, typename T4, typename T5,
11438 typename T6, typename T7, typename T8, typename T9, typename T10,
11439 typename T11, typename T12, typename T13, typename T14, typename T15,
11440 typename T16, typename T17, typename T18, typename T19, typename T20,
11441 typename T21>
11442class ValueArray21 {
11443 public:
11444 ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11445 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11446 T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11447 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11448 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11449 v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
11450
11451 template <typename T>
11452 operator ParamGenerator<T>() const {
11453 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11454 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11455 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11456 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11457 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11458 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11459 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11460 static_cast<T>(v21_)};
11461 return ValuesIn(array);
11462 }
11463
11464 private:
11465 // No implementation - assignment is unsupported.
11466 void operator=(const ValueArray21& other);
11467
11468 const T1 v1_;
11469 const T2 v2_;
11470 const T3 v3_;
11471 const T4 v4_;
11472 const T5 v5_;
11473 const T6 v6_;
11474 const T7 v7_;
11475 const T8 v8_;
11476 const T9 v9_;
11477 const T10 v10_;
11478 const T11 v11_;
11479 const T12 v12_;
11480 const T13 v13_;
11481 const T14 v14_;
11482 const T15 v15_;
11483 const T16 v16_;
11484 const T17 v17_;
11485 const T18 v18_;
11486 const T19 v19_;
11487 const T20 v20_;
11488 const T21 v21_;
11489};
11490
11491template <typename T1, typename T2, typename T3, typename T4, typename T5,
11492 typename T6, typename T7, typename T8, typename T9, typename T10,
11493 typename T11, typename T12, typename T13, typename T14, typename T15,
11494 typename T16, typename T17, typename T18, typename T19, typename T20,
11495 typename T21, typename T22>
11496class ValueArray22 {
11497 public:
11498 ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11499 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11500 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
11501 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11502 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11503 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
11504
11505 template <typename T>
11506 operator ParamGenerator<T>() const {
11507 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11508 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11509 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11510 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11511 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11512 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11513 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11514 static_cast<T>(v21_), static_cast<T>(v22_)};
11515 return ValuesIn(array);
11516 }
11517
11518 private:
11519 // No implementation - assignment is unsupported.
11520 void operator=(const ValueArray22& other);
11521
11522 const T1 v1_;
11523 const T2 v2_;
11524 const T3 v3_;
11525 const T4 v4_;
11526 const T5 v5_;
11527 const T6 v6_;
11528 const T7 v7_;
11529 const T8 v8_;
11530 const T9 v9_;
11531 const T10 v10_;
11532 const T11 v11_;
11533 const T12 v12_;
11534 const T13 v13_;
11535 const T14 v14_;
11536 const T15 v15_;
11537 const T16 v16_;
11538 const T17 v17_;
11539 const T18 v18_;
11540 const T19 v19_;
11541 const T20 v20_;
11542 const T21 v21_;
11543 const T22 v22_;
11544};
11545
11546template <typename T1, typename T2, typename T3, typename T4, typename T5,
11547 typename T6, typename T7, typename T8, typename T9, typename T10,
11548 typename T11, typename T12, typename T13, typename T14, typename T15,
11549 typename T16, typename T17, typename T18, typename T19, typename T20,
11550 typename T21, typename T22, typename T23>
11551class ValueArray23 {
11552 public:
11553 ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11554 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11555 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
11556 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11557 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11558 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11559 v23_(v23) {}
11560
11561 template <typename T>
11562 operator ParamGenerator<T>() const {
11563 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11564 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11565 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11566 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11567 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11568 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11569 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11570 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
11571 return ValuesIn(array);
11572 }
11573
11574 private:
11575 // No implementation - assignment is unsupported.
11576 void operator=(const ValueArray23& other);
11577
11578 const T1 v1_;
11579 const T2 v2_;
11580 const T3 v3_;
11581 const T4 v4_;
11582 const T5 v5_;
11583 const T6 v6_;
11584 const T7 v7_;
11585 const T8 v8_;
11586 const T9 v9_;
11587 const T10 v10_;
11588 const T11 v11_;
11589 const T12 v12_;
11590 const T13 v13_;
11591 const T14 v14_;
11592 const T15 v15_;
11593 const T16 v16_;
11594 const T17 v17_;
11595 const T18 v18_;
11596 const T19 v19_;
11597 const T20 v20_;
11598 const T21 v21_;
11599 const T22 v22_;
11600 const T23 v23_;
11601};
11602
11603template <typename T1, typename T2, typename T3, typename T4, typename T5,
11604 typename T6, typename T7, typename T8, typename T9, typename T10,
11605 typename T11, typename T12, typename T13, typename T14, typename T15,
11606 typename T16, typename T17, typename T18, typename T19, typename T20,
11607 typename T21, typename T22, typename T23, typename T24>
11608class ValueArray24 {
11609 public:
11610 ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11611 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11612 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
11613 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11614 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11615 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
11616 v22_(v22), v23_(v23), v24_(v24) {}
11617
11618 template <typename T>
11619 operator ParamGenerator<T>() const {
11620 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11621 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11622 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11623 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11624 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11625 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11626 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11627 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11628 static_cast<T>(v24_)};
11629 return ValuesIn(array);
11630 }
11631
11632 private:
11633 // No implementation - assignment is unsupported.
11634 void operator=(const ValueArray24& other);
11635
11636 const T1 v1_;
11637 const T2 v2_;
11638 const T3 v3_;
11639 const T4 v4_;
11640 const T5 v5_;
11641 const T6 v6_;
11642 const T7 v7_;
11643 const T8 v8_;
11644 const T9 v9_;
11645 const T10 v10_;
11646 const T11 v11_;
11647 const T12 v12_;
11648 const T13 v13_;
11649 const T14 v14_;
11650 const T15 v15_;
11651 const T16 v16_;
11652 const T17 v17_;
11653 const T18 v18_;
11654 const T19 v19_;
11655 const T20 v20_;
11656 const T21 v21_;
11657 const T22 v22_;
11658 const T23 v23_;
11659 const T24 v24_;
11660};
11661
11662template <typename T1, typename T2, typename T3, typename T4, typename T5,
11663 typename T6, typename T7, typename T8, typename T9, typename T10,
11664 typename T11, typename T12, typename T13, typename T14, typename T15,
11665 typename T16, typename T17, typename T18, typename T19, typename T20,
11666 typename T21, typename T22, typename T23, typename T24, typename T25>
11667class ValueArray25 {
11668 public:
11669 ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11670 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11671 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
11672 T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11673 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11674 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11675 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
11676
11677 template <typename T>
11678 operator ParamGenerator<T>() const {
11679 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11680 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11681 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11682 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11683 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11684 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11685 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11686 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11687 static_cast<T>(v24_), static_cast<T>(v25_)};
11688 return ValuesIn(array);
11689 }
11690
11691 private:
11692 // No implementation - assignment is unsupported.
11693 void operator=(const ValueArray25& other);
11694
11695 const T1 v1_;
11696 const T2 v2_;
11697 const T3 v3_;
11698 const T4 v4_;
11699 const T5 v5_;
11700 const T6 v6_;
11701 const T7 v7_;
11702 const T8 v8_;
11703 const T9 v9_;
11704 const T10 v10_;
11705 const T11 v11_;
11706 const T12 v12_;
11707 const T13 v13_;
11708 const T14 v14_;
11709 const T15 v15_;
11710 const T16 v16_;
11711 const T17 v17_;
11712 const T18 v18_;
11713 const T19 v19_;
11714 const T20 v20_;
11715 const T21 v21_;
11716 const T22 v22_;
11717 const T23 v23_;
11718 const T24 v24_;
11719 const T25 v25_;
11720};
11721
11722template <typename T1, typename T2, typename T3, typename T4, typename T5,
11723 typename T6, typename T7, typename T8, typename T9, typename T10,
11724 typename T11, typename T12, typename T13, typename T14, typename T15,
11725 typename T16, typename T17, typename T18, typename T19, typename T20,
11726 typename T21, typename T22, typename T23, typename T24, typename T25,
11727 typename T26>
11728class ValueArray26 {
11729 public:
11730 ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11731 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11732 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11733 T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11734 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11735 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11736 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
11737
11738 template <typename T>
11739 operator ParamGenerator<T>() const {
11740 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11741 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11742 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11743 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11744 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11745 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11746 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11747 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11748 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
11749 return ValuesIn(array);
11750 }
11751
11752 private:
11753 // No implementation - assignment is unsupported.
11754 void operator=(const ValueArray26& other);
11755
11756 const T1 v1_;
11757 const T2 v2_;
11758 const T3 v3_;
11759 const T4 v4_;
11760 const T5 v5_;
11761 const T6 v6_;
11762 const T7 v7_;
11763 const T8 v8_;
11764 const T9 v9_;
11765 const T10 v10_;
11766 const T11 v11_;
11767 const T12 v12_;
11768 const T13 v13_;
11769 const T14 v14_;
11770 const T15 v15_;
11771 const T16 v16_;
11772 const T17 v17_;
11773 const T18 v18_;
11774 const T19 v19_;
11775 const T20 v20_;
11776 const T21 v21_;
11777 const T22 v22_;
11778 const T23 v23_;
11779 const T24 v24_;
11780 const T25 v25_;
11781 const T26 v26_;
11782};
11783
11784template <typename T1, typename T2, typename T3, typename T4, typename T5,
11785 typename T6, typename T7, typename T8, typename T9, typename T10,
11786 typename T11, typename T12, typename T13, typename T14, typename T15,
11787 typename T16, typename T17, typename T18, typename T19, typename T20,
11788 typename T21, typename T22, typename T23, typename T24, typename T25,
11789 typename T26, typename T27>
11790class ValueArray27 {
11791 public:
11792 ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11793 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11794 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11795 T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11796 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11797 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
11798 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
11799 v26_(v26), v27_(v27) {}
11800
11801 template <typename T>
11802 operator ParamGenerator<T>() const {
11803 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11804 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11805 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11806 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11807 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11808 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11809 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11810 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11811 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11812 static_cast<T>(v27_)};
11813 return ValuesIn(array);
11814 }
11815
11816 private:
11817 // No implementation - assignment is unsupported.
11818 void operator=(const ValueArray27& other);
11819
11820 const T1 v1_;
11821 const T2 v2_;
11822 const T3 v3_;
11823 const T4 v4_;
11824 const T5 v5_;
11825 const T6 v6_;
11826 const T7 v7_;
11827 const T8 v8_;
11828 const T9 v9_;
11829 const T10 v10_;
11830 const T11 v11_;
11831 const T12 v12_;
11832 const T13 v13_;
11833 const T14 v14_;
11834 const T15 v15_;
11835 const T16 v16_;
11836 const T17 v17_;
11837 const T18 v18_;
11838 const T19 v19_;
11839 const T20 v20_;
11840 const T21 v21_;
11841 const T22 v22_;
11842 const T23 v23_;
11843 const T24 v24_;
11844 const T25 v25_;
11845 const T26 v26_;
11846 const T27 v27_;
11847};
11848
11849template <typename T1, typename T2, typename T3, typename T4, typename T5,
11850 typename T6, typename T7, typename T8, typename T9, typename T10,
11851 typename T11, typename T12, typename T13, typename T14, typename T15,
11852 typename T16, typename T17, typename T18, typename T19, typename T20,
11853 typename T21, typename T22, typename T23, typename T24, typename T25,
11854 typename T26, typename T27, typename T28>
11855class ValueArray28 {
11856 public:
11857 ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11858 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11859 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11860 T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11861 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11862 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11863 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
11864 v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
11865
11866 template <typename T>
11867 operator ParamGenerator<T>() const {
11868 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11869 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11870 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11871 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11872 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11873 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11874 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11875 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11876 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11877 static_cast<T>(v27_), static_cast<T>(v28_)};
11878 return ValuesIn(array);
11879 }
11880
11881 private:
11882 // No implementation - assignment is unsupported.
11883 void operator=(const ValueArray28& other);
11884
11885 const T1 v1_;
11886 const T2 v2_;
11887 const T3 v3_;
11888 const T4 v4_;
11889 const T5 v5_;
11890 const T6 v6_;
11891 const T7 v7_;
11892 const T8 v8_;
11893 const T9 v9_;
11894 const T10 v10_;
11895 const T11 v11_;
11896 const T12 v12_;
11897 const T13 v13_;
11898 const T14 v14_;
11899 const T15 v15_;
11900 const T16 v16_;
11901 const T17 v17_;
11902 const T18 v18_;
11903 const T19 v19_;
11904 const T20 v20_;
11905 const T21 v21_;
11906 const T22 v22_;
11907 const T23 v23_;
11908 const T24 v24_;
11909 const T25 v25_;
11910 const T26 v26_;
11911 const T27 v27_;
11912 const T28 v28_;
11913};
11914
11915template <typename T1, typename T2, typename T3, typename T4, typename T5,
11916 typename T6, typename T7, typename T8, typename T9, typename T10,
11917 typename T11, typename T12, typename T13, typename T14, typename T15,
11918 typename T16, typename T17, typename T18, typename T19, typename T20,
11919 typename T21, typename T22, typename T23, typename T24, typename T25,
11920 typename T26, typename T27, typename T28, typename T29>
11921class ValueArray29 {
11922 public:
11923 ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11924 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11925 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11926 T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11927 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11928 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11929 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
11930 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
11931
11932 template <typename T>
11933 operator ParamGenerator<T>() const {
11934 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11935 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11936 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11937 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11938 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11939 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11940 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11941 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11942 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11943 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
11944 return ValuesIn(array);
11945 }
11946
11947 private:
11948 // No implementation - assignment is unsupported.
11949 void operator=(const ValueArray29& other);
11950
11951 const T1 v1_;
11952 const T2 v2_;
11953 const T3 v3_;
11954 const T4 v4_;
11955 const T5 v5_;
11956 const T6 v6_;
11957 const T7 v7_;
11958 const T8 v8_;
11959 const T9 v9_;
11960 const T10 v10_;
11961 const T11 v11_;
11962 const T12 v12_;
11963 const T13 v13_;
11964 const T14 v14_;
11965 const T15 v15_;
11966 const T16 v16_;
11967 const T17 v17_;
11968 const T18 v18_;
11969 const T19 v19_;
11970 const T20 v20_;
11971 const T21 v21_;
11972 const T22 v22_;
11973 const T23 v23_;
11974 const T24 v24_;
11975 const T25 v25_;
11976 const T26 v26_;
11977 const T27 v27_;
11978 const T28 v28_;
11979 const T29 v29_;
11980};
11981
11982template <typename T1, typename T2, typename T3, typename T4, typename T5,
11983 typename T6, typename T7, typename T8, typename T9, typename T10,
11984 typename T11, typename T12, typename T13, typename T14, typename T15,
11985 typename T16, typename T17, typename T18, typename T19, typename T20,
11986 typename T21, typename T22, typename T23, typename T24, typename T25,
11987 typename T26, typename T27, typename T28, typename T29, typename T30>
11988class ValueArray30 {
11989 public:
11990 ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11991 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11992 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11993 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
11994 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11995 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11996 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11997 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
11998 v29_(v29), v30_(v30) {}
11999
12000 template <typename T>
12001 operator ParamGenerator<T>() const {
12002 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12003 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12004 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12005 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12006 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12007 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12008 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12009 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12010 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12011 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12012 static_cast<T>(v30_)};
12013 return ValuesIn(array);
12014 }
12015
12016 private:
12017 // No implementation - assignment is unsupported.
12018 void operator=(const ValueArray30& other);
12019
12020 const T1 v1_;
12021 const T2 v2_;
12022 const T3 v3_;
12023 const T4 v4_;
12024 const T5 v5_;
12025 const T6 v6_;
12026 const T7 v7_;
12027 const T8 v8_;
12028 const T9 v9_;
12029 const T10 v10_;
12030 const T11 v11_;
12031 const T12 v12_;
12032 const T13 v13_;
12033 const T14 v14_;
12034 const T15 v15_;
12035 const T16 v16_;
12036 const T17 v17_;
12037 const T18 v18_;
12038 const T19 v19_;
12039 const T20 v20_;
12040 const T21 v21_;
12041 const T22 v22_;
12042 const T23 v23_;
12043 const T24 v24_;
12044 const T25 v25_;
12045 const T26 v26_;
12046 const T27 v27_;
12047 const T28 v28_;
12048 const T29 v29_;
12049 const T30 v30_;
12050};
12051
12052template <typename T1, typename T2, typename T3, typename T4, typename T5,
12053 typename T6, typename T7, typename T8, typename T9, typename T10,
12054 typename T11, typename T12, typename T13, typename T14, typename T15,
12055 typename T16, typename T17, typename T18, typename T19, typename T20,
12056 typename T21, typename T22, typename T23, typename T24, typename T25,
12057 typename T26, typename T27, typename T28, typename T29, typename T30,
12058 typename T31>
12059class ValueArray31 {
12060 public:
12061 ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12062 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12063 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12064 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
12065 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12066 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12067 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12068 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12069 v29_(v29), v30_(v30), v31_(v31) {}
12070
12071 template <typename T>
12072 operator ParamGenerator<T>() const {
12073 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12074 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12075 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12076 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12077 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12078 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12079 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12080 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12081 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12082 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12083 static_cast<T>(v30_), static_cast<T>(v31_)};
12084 return ValuesIn(array);
12085 }
12086
12087 private:
12088 // No implementation - assignment is unsupported.
12089 void operator=(const ValueArray31& other);
12090
12091 const T1 v1_;
12092 const T2 v2_;
12093 const T3 v3_;
12094 const T4 v4_;
12095 const T5 v5_;
12096 const T6 v6_;
12097 const T7 v7_;
12098 const T8 v8_;
12099 const T9 v9_;
12100 const T10 v10_;
12101 const T11 v11_;
12102 const T12 v12_;
12103 const T13 v13_;
12104 const T14 v14_;
12105 const T15 v15_;
12106 const T16 v16_;
12107 const T17 v17_;
12108 const T18 v18_;
12109 const T19 v19_;
12110 const T20 v20_;
12111 const T21 v21_;
12112 const T22 v22_;
12113 const T23 v23_;
12114 const T24 v24_;
12115 const T25 v25_;
12116 const T26 v26_;
12117 const T27 v27_;
12118 const T28 v28_;
12119 const T29 v29_;
12120 const T30 v30_;
12121 const T31 v31_;
12122};
12123
12124template <typename T1, typename T2, typename T3, typename T4, typename T5,
12125 typename T6, typename T7, typename T8, typename T9, typename T10,
12126 typename T11, typename T12, typename T13, typename T14, typename T15,
12127 typename T16, typename T17, typename T18, typename T19, typename T20,
12128 typename T21, typename T22, typename T23, typename T24, typename T25,
12129 typename T26, typename T27, typename T28, typename T29, typename T30,
12130 typename T31, typename T32>
12131class ValueArray32 {
12132 public:
12133 ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12134 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12135 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12136 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
12137 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12138 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12139 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12140 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12141 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
12142
12143 template <typename T>
12144 operator ParamGenerator<T>() const {
12145 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12146 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12147 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12148 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12149 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12150 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12151 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12152 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12153 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12154 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12155 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
12156 return ValuesIn(array);
12157 }
12158
12159 private:
12160 // No implementation - assignment is unsupported.
12161 void operator=(const ValueArray32& other);
12162
12163 const T1 v1_;
12164 const T2 v2_;
12165 const T3 v3_;
12166 const T4 v4_;
12167 const T5 v5_;
12168 const T6 v6_;
12169 const T7 v7_;
12170 const T8 v8_;
12171 const T9 v9_;
12172 const T10 v10_;
12173 const T11 v11_;
12174 const T12 v12_;
12175 const T13 v13_;
12176 const T14 v14_;
12177 const T15 v15_;
12178 const T16 v16_;
12179 const T17 v17_;
12180 const T18 v18_;
12181 const T19 v19_;
12182 const T20 v20_;
12183 const T21 v21_;
12184 const T22 v22_;
12185 const T23 v23_;
12186 const T24 v24_;
12187 const T25 v25_;
12188 const T26 v26_;
12189 const T27 v27_;
12190 const T28 v28_;
12191 const T29 v29_;
12192 const T30 v30_;
12193 const T31 v31_;
12194 const T32 v32_;
12195};
12196
12197template <typename T1, typename T2, typename T3, typename T4, typename T5,
12198 typename T6, typename T7, typename T8, typename T9, typename T10,
12199 typename T11, typename T12, typename T13, typename T14, typename T15,
12200 typename T16, typename T17, typename T18, typename T19, typename T20,
12201 typename T21, typename T22, typename T23, typename T24, typename T25,
12202 typename T26, typename T27, typename T28, typename T29, typename T30,
12203 typename T31, typename T32, typename T33>
12204class ValueArray33 {
12205 public:
12206 ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12207 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12208 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12209 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
12210 T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12211 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12212 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12213 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12214 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12215 v33_(v33) {}
12216
12217 template <typename T>
12218 operator ParamGenerator<T>() const {
12219 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12220 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12221 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12222 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12223 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12224 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12225 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12226 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12227 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12228 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12229 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12230 static_cast<T>(v33_)};
12231 return ValuesIn(array);
12232 }
12233
12234 private:
12235 // No implementation - assignment is unsupported.
12236 void operator=(const ValueArray33& other);
12237
12238 const T1 v1_;
12239 const T2 v2_;
12240 const T3 v3_;
12241 const T4 v4_;
12242 const T5 v5_;
12243 const T6 v6_;
12244 const T7 v7_;
12245 const T8 v8_;
12246 const T9 v9_;
12247 const T10 v10_;
12248 const T11 v11_;
12249 const T12 v12_;
12250 const T13 v13_;
12251 const T14 v14_;
12252 const T15 v15_;
12253 const T16 v16_;
12254 const T17 v17_;
12255 const T18 v18_;
12256 const T19 v19_;
12257 const T20 v20_;
12258 const T21 v21_;
12259 const T22 v22_;
12260 const T23 v23_;
12261 const T24 v24_;
12262 const T25 v25_;
12263 const T26 v26_;
12264 const T27 v27_;
12265 const T28 v28_;
12266 const T29 v29_;
12267 const T30 v30_;
12268 const T31 v31_;
12269 const T32 v32_;
12270 const T33 v33_;
12271};
12272
12273template <typename T1, typename T2, typename T3, typename T4, typename T5,
12274 typename T6, typename T7, typename T8, typename T9, typename T10,
12275 typename T11, typename T12, typename T13, typename T14, typename T15,
12276 typename T16, typename T17, typename T18, typename T19, typename T20,
12277 typename T21, typename T22, typename T23, typename T24, typename T25,
12278 typename T26, typename T27, typename T28, typename T29, typename T30,
12279 typename T31, typename T32, typename T33, typename T34>
12280class ValueArray34 {
12281 public:
12282 ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12283 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12284 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12285 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12286 T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12287 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12288 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12289 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12290 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12291 v33_(v33), v34_(v34) {}
12292
12293 template <typename T>
12294 operator ParamGenerator<T>() const {
12295 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12296 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12297 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12298 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12299 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12300 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12301 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12302 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12303 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12304 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12305 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12306 static_cast<T>(v33_), static_cast<T>(v34_)};
12307 return ValuesIn(array);
12308 }
12309
12310 private:
12311 // No implementation - assignment is unsupported.
12312 void operator=(const ValueArray34& other);
12313
12314 const T1 v1_;
12315 const T2 v2_;
12316 const T3 v3_;
12317 const T4 v4_;
12318 const T5 v5_;
12319 const T6 v6_;
12320 const T7 v7_;
12321 const T8 v8_;
12322 const T9 v9_;
12323 const T10 v10_;
12324 const T11 v11_;
12325 const T12 v12_;
12326 const T13 v13_;
12327 const T14 v14_;
12328 const T15 v15_;
12329 const T16 v16_;
12330 const T17 v17_;
12331 const T18 v18_;
12332 const T19 v19_;
12333 const T20 v20_;
12334 const T21 v21_;
12335 const T22 v22_;
12336 const T23 v23_;
12337 const T24 v24_;
12338 const T25 v25_;
12339 const T26 v26_;
12340 const T27 v27_;
12341 const T28 v28_;
12342 const T29 v29_;
12343 const T30 v30_;
12344 const T31 v31_;
12345 const T32 v32_;
12346 const T33 v33_;
12347 const T34 v34_;
12348};
12349
12350template <typename T1, typename T2, typename T3, typename T4, typename T5,
12351 typename T6, typename T7, typename T8, typename T9, typename T10,
12352 typename T11, typename T12, typename T13, typename T14, typename T15,
12353 typename T16, typename T17, typename T18, typename T19, typename T20,
12354 typename T21, typename T22, typename T23, typename T24, typename T25,
12355 typename T26, typename T27, typename T28, typename T29, typename T30,
12356 typename T31, typename T32, typename T33, typename T34, typename T35>
12357class ValueArray35 {
12358 public:
12359 ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12360 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12361 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12362 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12363 T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12364 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12365 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12366 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12367 v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12368 v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
12369
12370 template <typename T>
12371 operator ParamGenerator<T>() const {
12372 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12373 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12374 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12375 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12376 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12377 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12378 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12379 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12380 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12381 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12382 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12383 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
12384 return ValuesIn(array);
12385 }
12386
12387 private:
12388 // No implementation - assignment is unsupported.
12389 void operator=(const ValueArray35& other);
12390
12391 const T1 v1_;
12392 const T2 v2_;
12393 const T3 v3_;
12394 const T4 v4_;
12395 const T5 v5_;
12396 const T6 v6_;
12397 const T7 v7_;
12398 const T8 v8_;
12399 const T9 v9_;
12400 const T10 v10_;
12401 const T11 v11_;
12402 const T12 v12_;
12403 const T13 v13_;
12404 const T14 v14_;
12405 const T15 v15_;
12406 const T16 v16_;
12407 const T17 v17_;
12408 const T18 v18_;
12409 const T19 v19_;
12410 const T20 v20_;
12411 const T21 v21_;
12412 const T22 v22_;
12413 const T23 v23_;
12414 const T24 v24_;
12415 const T25 v25_;
12416 const T26 v26_;
12417 const T27 v27_;
12418 const T28 v28_;
12419 const T29 v29_;
12420 const T30 v30_;
12421 const T31 v31_;
12422 const T32 v32_;
12423 const T33 v33_;
12424 const T34 v34_;
12425 const T35 v35_;
12426};
12427
12428template <typename T1, typename T2, typename T3, typename T4, typename T5,
12429 typename T6, typename T7, typename T8, typename T9, typename T10,
12430 typename T11, typename T12, typename T13, typename T14, typename T15,
12431 typename T16, typename T17, typename T18, typename T19, typename T20,
12432 typename T21, typename T22, typename T23, typename T24, typename T25,
12433 typename T26, typename T27, typename T28, typename T29, typename T30,
12434 typename T31, typename T32, typename T33, typename T34, typename T35,
12435 typename T36>
12436class ValueArray36 {
12437 public:
12438 ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12439 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12440 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12441 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12442 T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12443 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12444 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12445 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
12446 v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
12447 v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
12448
12449 template <typename T>
12450 operator ParamGenerator<T>() const {
12451 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12452 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12453 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12454 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12455 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12456 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12457 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12458 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12459 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12460 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12461 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12462 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12463 static_cast<T>(v36_)};
12464 return ValuesIn(array);
12465 }
12466
12467 private:
12468 // No implementation - assignment is unsupported.
12469 void operator=(const ValueArray36& other);
12470
12471 const T1 v1_;
12472 const T2 v2_;
12473 const T3 v3_;
12474 const T4 v4_;
12475 const T5 v5_;
12476 const T6 v6_;
12477 const T7 v7_;
12478 const T8 v8_;
12479 const T9 v9_;
12480 const T10 v10_;
12481 const T11 v11_;
12482 const T12 v12_;
12483 const T13 v13_;
12484 const T14 v14_;
12485 const T15 v15_;
12486 const T16 v16_;
12487 const T17 v17_;
12488 const T18 v18_;
12489 const T19 v19_;
12490 const T20 v20_;
12491 const T21 v21_;
12492 const T22 v22_;
12493 const T23 v23_;
12494 const T24 v24_;
12495 const T25 v25_;
12496 const T26 v26_;
12497 const T27 v27_;
12498 const T28 v28_;
12499 const T29 v29_;
12500 const T30 v30_;
12501 const T31 v31_;
12502 const T32 v32_;
12503 const T33 v33_;
12504 const T34 v34_;
12505 const T35 v35_;
12506 const T36 v36_;
12507};
12508
12509template <typename T1, typename T2, typename T3, typename T4, typename T5,
12510 typename T6, typename T7, typename T8, typename T9, typename T10,
12511 typename T11, typename T12, typename T13, typename T14, typename T15,
12512 typename T16, typename T17, typename T18, typename T19, typename T20,
12513 typename T21, typename T22, typename T23, typename T24, typename T25,
12514 typename T26, typename T27, typename T28, typename T29, typename T30,
12515 typename T31, typename T32, typename T33, typename T34, typename T35,
12516 typename T36, typename T37>
12517class ValueArray37 {
12518 public:
12519 ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12520 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12521 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12522 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12523 T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12524 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12525 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12526 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
12527 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
12528 v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
12529 v36_(v36), v37_(v37) {}
12530
12531 template <typename T>
12532 operator ParamGenerator<T>() const {
12533 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12534 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12535 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12536 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12537 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12538 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12539 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12540 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12541 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12542 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12543 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12544 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12545 static_cast<T>(v36_), static_cast<T>(v37_)};
12546 return ValuesIn(array);
12547 }
12548
12549 private:
12550 // No implementation - assignment is unsupported.
12551 void operator=(const ValueArray37& other);
12552
12553 const T1 v1_;
12554 const T2 v2_;
12555 const T3 v3_;
12556 const T4 v4_;
12557 const T5 v5_;
12558 const T6 v6_;
12559 const T7 v7_;
12560 const T8 v8_;
12561 const T9 v9_;
12562 const T10 v10_;
12563 const T11 v11_;
12564 const T12 v12_;
12565 const T13 v13_;
12566 const T14 v14_;
12567 const T15 v15_;
12568 const T16 v16_;
12569 const T17 v17_;
12570 const T18 v18_;
12571 const T19 v19_;
12572 const T20 v20_;
12573 const T21 v21_;
12574 const T22 v22_;
12575 const T23 v23_;
12576 const T24 v24_;
12577 const T25 v25_;
12578 const T26 v26_;
12579 const T27 v27_;
12580 const T28 v28_;
12581 const T29 v29_;
12582 const T30 v30_;
12583 const T31 v31_;
12584 const T32 v32_;
12585 const T33 v33_;
12586 const T34 v34_;
12587 const T35 v35_;
12588 const T36 v36_;
12589 const T37 v37_;
12590};
12591
12592template <typename T1, typename T2, typename T3, typename T4, typename T5,
12593 typename T6, typename T7, typename T8, typename T9, typename T10,
12594 typename T11, typename T12, typename T13, typename T14, typename T15,
12595 typename T16, typename T17, typename T18, typename T19, typename T20,
12596 typename T21, typename T22, typename T23, typename T24, typename T25,
12597 typename T26, typename T27, typename T28, typename T29, typename T30,
12598 typename T31, typename T32, typename T33, typename T34, typename T35,
12599 typename T36, typename T37, typename T38>
12600class ValueArray38 {
12601 public:
12602 ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12603 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12604 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12605 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12606 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
12607 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12608 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12609 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12610 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12611 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12612 v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
12613
12614 template <typename T>
12615 operator ParamGenerator<T>() const {
12616 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12617 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12618 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12619 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12620 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12621 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12622 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12623 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12624 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12625 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12626 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12627 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12628 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
12629 return ValuesIn(array);
12630 }
12631
12632 private:
12633 // No implementation - assignment is unsupported.
12634 void operator=(const ValueArray38& other);
12635
12636 const T1 v1_;
12637 const T2 v2_;
12638 const T3 v3_;
12639 const T4 v4_;
12640 const T5 v5_;
12641 const T6 v6_;
12642 const T7 v7_;
12643 const T8 v8_;
12644 const T9 v9_;
12645 const T10 v10_;
12646 const T11 v11_;
12647 const T12 v12_;
12648 const T13 v13_;
12649 const T14 v14_;
12650 const T15 v15_;
12651 const T16 v16_;
12652 const T17 v17_;
12653 const T18 v18_;
12654 const T19 v19_;
12655 const T20 v20_;
12656 const T21 v21_;
12657 const T22 v22_;
12658 const T23 v23_;
12659 const T24 v24_;
12660 const T25 v25_;
12661 const T26 v26_;
12662 const T27 v27_;
12663 const T28 v28_;
12664 const T29 v29_;
12665 const T30 v30_;
12666 const T31 v31_;
12667 const T32 v32_;
12668 const T33 v33_;
12669 const T34 v34_;
12670 const T35 v35_;
12671 const T36 v36_;
12672 const T37 v37_;
12673 const T38 v38_;
12674};
12675
12676template <typename T1, typename T2, typename T3, typename T4, typename T5,
12677 typename T6, typename T7, typename T8, typename T9, typename T10,
12678 typename T11, typename T12, typename T13, typename T14, typename T15,
12679 typename T16, typename T17, typename T18, typename T19, typename T20,
12680 typename T21, typename T22, typename T23, typename T24, typename T25,
12681 typename T26, typename T27, typename T28, typename T29, typename T30,
12682 typename T31, typename T32, typename T33, typename T34, typename T35,
12683 typename T36, typename T37, typename T38, typename T39>
12684class ValueArray39 {
12685 public:
12686 ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12687 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12688 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12689 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12690 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
12691 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12692 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12693 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12694 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12695 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12696 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
12697
12698 template <typename T>
12699 operator ParamGenerator<T>() const {
12700 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12701 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12702 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12703 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12704 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12705 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12706 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12707 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12708 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12709 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12710 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12711 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12712 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12713 static_cast<T>(v39_)};
12714 return ValuesIn(array);
12715 }
12716
12717 private:
12718 // No implementation - assignment is unsupported.
12719 void operator=(const ValueArray39& other);
12720
12721 const T1 v1_;
12722 const T2 v2_;
12723 const T3 v3_;
12724 const T4 v4_;
12725 const T5 v5_;
12726 const T6 v6_;
12727 const T7 v7_;
12728 const T8 v8_;
12729 const T9 v9_;
12730 const T10 v10_;
12731 const T11 v11_;
12732 const T12 v12_;
12733 const T13 v13_;
12734 const T14 v14_;
12735 const T15 v15_;
12736 const T16 v16_;
12737 const T17 v17_;
12738 const T18 v18_;
12739 const T19 v19_;
12740 const T20 v20_;
12741 const T21 v21_;
12742 const T22 v22_;
12743 const T23 v23_;
12744 const T24 v24_;
12745 const T25 v25_;
12746 const T26 v26_;
12747 const T27 v27_;
12748 const T28 v28_;
12749 const T29 v29_;
12750 const T30 v30_;
12751 const T31 v31_;
12752 const T32 v32_;
12753 const T33 v33_;
12754 const T34 v34_;
12755 const T35 v35_;
12756 const T36 v36_;
12757 const T37 v37_;
12758 const T38 v38_;
12759 const T39 v39_;
12760};
12761
12762template <typename T1, typename T2, typename T3, typename T4, typename T5,
12763 typename T6, typename T7, typename T8, typename T9, typename T10,
12764 typename T11, typename T12, typename T13, typename T14, typename T15,
12765 typename T16, typename T17, typename T18, typename T19, typename T20,
12766 typename T21, typename T22, typename T23, typename T24, typename T25,
12767 typename T26, typename T27, typename T28, typename T29, typename T30,
12768 typename T31, typename T32, typename T33, typename T34, typename T35,
12769 typename T36, typename T37, typename T38, typename T39, typename T40>
12770class ValueArray40 {
12771 public:
12772 ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12773 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12774 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12775 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12776 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
12777 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12778 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12779 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12780 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12781 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
12782 v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
12783 v40_(v40) {}
12784
12785 template <typename T>
12786 operator ParamGenerator<T>() const {
12787 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12788 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12789 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12790 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12791 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12792 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12793 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12794 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12795 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12796 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12797 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12798 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12799 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12800 static_cast<T>(v39_), static_cast<T>(v40_)};
12801 return ValuesIn(array);
12802 }
12803
12804 private:
12805 // No implementation - assignment is unsupported.
12806 void operator=(const ValueArray40& other);
12807
12808 const T1 v1_;
12809 const T2 v2_;
12810 const T3 v3_;
12811 const T4 v4_;
12812 const T5 v5_;
12813 const T6 v6_;
12814 const T7 v7_;
12815 const T8 v8_;
12816 const T9 v9_;
12817 const T10 v10_;
12818 const T11 v11_;
12819 const T12 v12_;
12820 const T13 v13_;
12821 const T14 v14_;
12822 const T15 v15_;
12823 const T16 v16_;
12824 const T17 v17_;
12825 const T18 v18_;
12826 const T19 v19_;
12827 const T20 v20_;
12828 const T21 v21_;
12829 const T22 v22_;
12830 const T23 v23_;
12831 const T24 v24_;
12832 const T25 v25_;
12833 const T26 v26_;
12834 const T27 v27_;
12835 const T28 v28_;
12836 const T29 v29_;
12837 const T30 v30_;
12838 const T31 v31_;
12839 const T32 v32_;
12840 const T33 v33_;
12841 const T34 v34_;
12842 const T35 v35_;
12843 const T36 v36_;
12844 const T37 v37_;
12845 const T38 v38_;
12846 const T39 v39_;
12847 const T40 v40_;
12848};
12849
12850template <typename T1, typename T2, typename T3, typename T4, typename T5,
12851 typename T6, typename T7, typename T8, typename T9, typename T10,
12852 typename T11, typename T12, typename T13, typename T14, typename T15,
12853 typename T16, typename T17, typename T18, typename T19, typename T20,
12854 typename T21, typename T22, typename T23, typename T24, typename T25,
12855 typename T26, typename T27, typename T28, typename T29, typename T30,
12856 typename T31, typename T32, typename T33, typename T34, typename T35,
12857 typename T36, typename T37, typename T38, typename T39, typename T40,
12858 typename T41>
12859class ValueArray41 {
12860 public:
12861 ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12862 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12863 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12864 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12865 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
12866 T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12867 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12868 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12869 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12870 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12871 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12872 v39_(v39), v40_(v40), v41_(v41) {}
12873
12874 template <typename T>
12875 operator ParamGenerator<T>() const {
12876 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12877 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12878 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12879 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12880 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12881 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12882 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12883 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12884 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12885 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12886 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12887 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12888 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12889 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
12890 return ValuesIn(array);
12891 }
12892
12893 private:
12894 // No implementation - assignment is unsupported.
12895 void operator=(const ValueArray41& other);
12896
12897 const T1 v1_;
12898 const T2 v2_;
12899 const T3 v3_;
12900 const T4 v4_;
12901 const T5 v5_;
12902 const T6 v6_;
12903 const T7 v7_;
12904 const T8 v8_;
12905 const T9 v9_;
12906 const T10 v10_;
12907 const T11 v11_;
12908 const T12 v12_;
12909 const T13 v13_;
12910 const T14 v14_;
12911 const T15 v15_;
12912 const T16 v16_;
12913 const T17 v17_;
12914 const T18 v18_;
12915 const T19 v19_;
12916 const T20 v20_;
12917 const T21 v21_;
12918 const T22 v22_;
12919 const T23 v23_;
12920 const T24 v24_;
12921 const T25 v25_;
12922 const T26 v26_;
12923 const T27 v27_;
12924 const T28 v28_;
12925 const T29 v29_;
12926 const T30 v30_;
12927 const T31 v31_;
12928 const T32 v32_;
12929 const T33 v33_;
12930 const T34 v34_;
12931 const T35 v35_;
12932 const T36 v36_;
12933 const T37 v37_;
12934 const T38 v38_;
12935 const T39 v39_;
12936 const T40 v40_;
12937 const T41 v41_;
12938};
12939
12940template <typename T1, typename T2, typename T3, typename T4, typename T5,
12941 typename T6, typename T7, typename T8, typename T9, typename T10,
12942 typename T11, typename T12, typename T13, typename T14, typename T15,
12943 typename T16, typename T17, typename T18, typename T19, typename T20,
12944 typename T21, typename T22, typename T23, typename T24, typename T25,
12945 typename T26, typename T27, typename T28, typename T29, typename T30,
12946 typename T31, typename T32, typename T33, typename T34, typename T35,
12947 typename T36, typename T37, typename T38, typename T39, typename T40,
12948 typename T41, typename T42>
12949class ValueArray42 {
12950 public:
12951 ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12952 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12953 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12954 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12955 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12956 T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12957 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12958 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12959 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12960 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12961 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12962 v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
12963
12964 template <typename T>
12965 operator ParamGenerator<T>() const {
12966 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12967 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12968 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12969 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12970 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12971 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12972 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12973 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12974 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12975 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12976 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12977 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12978 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12979 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
12980 static_cast<T>(v42_)};
12981 return ValuesIn(array);
12982 }
12983
12984 private:
12985 // No implementation - assignment is unsupported.
12986 void operator=(const ValueArray42& other);
12987
12988 const T1 v1_;
12989 const T2 v2_;
12990 const T3 v3_;
12991 const T4 v4_;
12992 const T5 v5_;
12993 const T6 v6_;
12994 const T7 v7_;
12995 const T8 v8_;
12996 const T9 v9_;
12997 const T10 v10_;
12998 const T11 v11_;
12999 const T12 v12_;
13000 const T13 v13_;
13001 const T14 v14_;
13002 const T15 v15_;
13003 const T16 v16_;
13004 const T17 v17_;
13005 const T18 v18_;
13006 const T19 v19_;
13007 const T20 v20_;
13008 const T21 v21_;
13009 const T22 v22_;
13010 const T23 v23_;
13011 const T24 v24_;
13012 const T25 v25_;
13013 const T26 v26_;
13014 const T27 v27_;
13015 const T28 v28_;
13016 const T29 v29_;
13017 const T30 v30_;
13018 const T31 v31_;
13019 const T32 v32_;
13020 const T33 v33_;
13021 const T34 v34_;
13022 const T35 v35_;
13023 const T36 v36_;
13024 const T37 v37_;
13025 const T38 v38_;
13026 const T39 v39_;
13027 const T40 v40_;
13028 const T41 v41_;
13029 const T42 v42_;
13030};
13031
13032template <typename T1, typename T2, typename T3, typename T4, typename T5,
13033 typename T6, typename T7, typename T8, typename T9, typename T10,
13034 typename T11, typename T12, typename T13, typename T14, typename T15,
13035 typename T16, typename T17, typename T18, typename T19, typename T20,
13036 typename T21, typename T22, typename T23, typename T24, typename T25,
13037 typename T26, typename T27, typename T28, typename T29, typename T30,
13038 typename T31, typename T32, typename T33, typename T34, typename T35,
13039 typename T36, typename T37, typename T38, typename T39, typename T40,
13040 typename T41, typename T42, typename T43>
13041class ValueArray43 {
13042 public:
13043 ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13044 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13045 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13046 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13047 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13048 T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
13049 v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
13050 v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
13051 v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
13052 v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
13053 v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
13054 v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
13055
13056 template <typename T>
13057 operator ParamGenerator<T>() const {
13058 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13059 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13060 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13061 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13062 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13063 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13064 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13065 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13066 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13067 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13068 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13069 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13070 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13071 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13072 static_cast<T>(v42_), static_cast<T>(v43_)};
13073 return ValuesIn(array);
13074 }
13075
13076 private:
13077 // No implementation - assignment is unsupported.
13078 void operator=(const ValueArray43& other);
13079
13080 const T1 v1_;
13081 const T2 v2_;
13082 const T3 v3_;
13083 const T4 v4_;
13084 const T5 v5_;
13085 const T6 v6_;
13086 const T7 v7_;
13087 const T8 v8_;
13088 const T9 v9_;
13089 const T10 v10_;
13090 const T11 v11_;
13091 const T12 v12_;
13092 const T13 v13_;
13093 const T14 v14_;
13094 const T15 v15_;
13095 const T16 v16_;
13096 const T17 v17_;
13097 const T18 v18_;
13098 const T19 v19_;
13099 const T20 v20_;
13100 const T21 v21_;
13101 const T22 v22_;
13102 const T23 v23_;
13103 const T24 v24_;
13104 const T25 v25_;
13105 const T26 v26_;
13106 const T27 v27_;
13107 const T28 v28_;
13108 const T29 v29_;
13109 const T30 v30_;
13110 const T31 v31_;
13111 const T32 v32_;
13112 const T33 v33_;
13113 const T34 v34_;
13114 const T35 v35_;
13115 const T36 v36_;
13116 const T37 v37_;
13117 const T38 v38_;
13118 const T39 v39_;
13119 const T40 v40_;
13120 const T41 v41_;
13121 const T42 v42_;
13122 const T43 v43_;
13123};
13124
13125template <typename T1, typename T2, typename T3, typename T4, typename T5,
13126 typename T6, typename T7, typename T8, typename T9, typename T10,
13127 typename T11, typename T12, typename T13, typename T14, typename T15,
13128 typename T16, typename T17, typename T18, typename T19, typename T20,
13129 typename T21, typename T22, typename T23, typename T24, typename T25,
13130 typename T26, typename T27, typename T28, typename T29, typename T30,
13131 typename T31, typename T32, typename T33, typename T34, typename T35,
13132 typename T36, typename T37, typename T38, typename T39, typename T40,
13133 typename T41, typename T42, typename T43, typename T44>
13134class ValueArray44 {
13135 public:
13136 ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13137 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13138 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13139 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13140 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13141 T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
13142 v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
13143 v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
13144 v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
13145 v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
13146 v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
13147 v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
13148 v43_(v43), v44_(v44) {}
13149
13150 template <typename T>
13151 operator ParamGenerator<T>() const {
13152 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13153 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13154 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13155 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13156 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13157 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13158 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13159 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13160 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13161 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13162 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13163 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13164 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13165 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13166 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
13167 return ValuesIn(array);
13168 }
13169
13170 private:
13171 // No implementation - assignment is unsupported.
13172 void operator=(const ValueArray44& other);
13173
13174 const T1 v1_;
13175 const T2 v2_;
13176 const T3 v3_;
13177 const T4 v4_;
13178 const T5 v5_;
13179 const T6 v6_;
13180 const T7 v7_;
13181 const T8 v8_;
13182 const T9 v9_;
13183 const T10 v10_;
13184 const T11 v11_;
13185 const T12 v12_;
13186 const T13 v13_;
13187 const T14 v14_;
13188 const T15 v15_;
13189 const T16 v16_;
13190 const T17 v17_;
13191 const T18 v18_;
13192 const T19 v19_;
13193 const T20 v20_;
13194 const T21 v21_;
13195 const T22 v22_;
13196 const T23 v23_;
13197 const T24 v24_;
13198 const T25 v25_;
13199 const T26 v26_;
13200 const T27 v27_;
13201 const T28 v28_;
13202 const T29 v29_;
13203 const T30 v30_;
13204 const T31 v31_;
13205 const T32 v32_;
13206 const T33 v33_;
13207 const T34 v34_;
13208 const T35 v35_;
13209 const T36 v36_;
13210 const T37 v37_;
13211 const T38 v38_;
13212 const T39 v39_;
13213 const T40 v40_;
13214 const T41 v41_;
13215 const T42 v42_;
13216 const T43 v43_;
13217 const T44 v44_;
13218};
13219
13220template <typename T1, typename T2, typename T3, typename T4, typename T5,
13221 typename T6, typename T7, typename T8, typename T9, typename T10,
13222 typename T11, typename T12, typename T13, typename T14, typename T15,
13223 typename T16, typename T17, typename T18, typename T19, typename T20,
13224 typename T21, typename T22, typename T23, typename T24, typename T25,
13225 typename T26, typename T27, typename T28, typename T29, typename T30,
13226 typename T31, typename T32, typename T33, typename T34, typename T35,
13227 typename T36, typename T37, typename T38, typename T39, typename T40,
13228 typename T41, typename T42, typename T43, typename T44, typename T45>
13229class ValueArray45 {
13230 public:
13231 ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13232 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13233 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13234 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13235 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13236 T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
13237 v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
13238 v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
13239 v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
13240 v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
13241 v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
13242 v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
13243 v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
13244
13245 template <typename T>
13246 operator ParamGenerator<T>() const {
13247 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13248 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13249 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13250 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13251 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13252 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13253 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13254 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13255 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13256 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13257 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13258 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13259 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13260 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13261 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13262 static_cast<T>(v45_)};
13263 return ValuesIn(array);
13264 }
13265
13266 private:
13267 // No implementation - assignment is unsupported.
13268 void operator=(const ValueArray45& other);
13269
13270 const T1 v1_;
13271 const T2 v2_;
13272 const T3 v3_;
13273 const T4 v4_;
13274 const T5 v5_;
13275 const T6 v6_;
13276 const T7 v7_;
13277 const T8 v8_;
13278 const T9 v9_;
13279 const T10 v10_;
13280 const T11 v11_;
13281 const T12 v12_;
13282 const T13 v13_;
13283 const T14 v14_;
13284 const T15 v15_;
13285 const T16 v16_;
13286 const T17 v17_;
13287 const T18 v18_;
13288 const T19 v19_;
13289 const T20 v20_;
13290 const T21 v21_;
13291 const T22 v22_;
13292 const T23 v23_;
13293 const T24 v24_;
13294 const T25 v25_;
13295 const T26 v26_;
13296 const T27 v27_;
13297 const T28 v28_;
13298 const T29 v29_;
13299 const T30 v30_;
13300 const T31 v31_;
13301 const T32 v32_;
13302 const T33 v33_;
13303 const T34 v34_;
13304 const T35 v35_;
13305 const T36 v36_;
13306 const T37 v37_;
13307 const T38 v38_;
13308 const T39 v39_;
13309 const T40 v40_;
13310 const T41 v41_;
13311 const T42 v42_;
13312 const T43 v43_;
13313 const T44 v44_;
13314 const T45 v45_;
13315};
13316
13317template <typename T1, typename T2, typename T3, typename T4, typename T5,
13318 typename T6, typename T7, typename T8, typename T9, typename T10,
13319 typename T11, typename T12, typename T13, typename T14, typename T15,
13320 typename T16, typename T17, typename T18, typename T19, typename T20,
13321 typename T21, typename T22, typename T23, typename T24, typename T25,
13322 typename T26, typename T27, typename T28, typename T29, typename T30,
13323 typename T31, typename T32, typename T33, typename T34, typename T35,
13324 typename T36, typename T37, typename T38, typename T39, typename T40,
13325 typename T41, typename T42, typename T43, typename T44, typename T45,
13326 typename T46>
13327class ValueArray46 {
13328 public:
13329 ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13330 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13331 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13332 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13333 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13334 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
13335 v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13336 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13337 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13338 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13339 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13340 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13341 v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
13342
13343 template <typename T>
13344 operator ParamGenerator<T>() const {
13345 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13346 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13347 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13348 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13349 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13350 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13351 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13352 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13353 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13354 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13355 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13356 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13357 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13358 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13359 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13360 static_cast<T>(v45_), static_cast<T>(v46_)};
13361 return ValuesIn(array);
13362 }
13363
13364 private:
13365 // No implementation - assignment is unsupported.
13366 void operator=(const ValueArray46& other);
13367
13368 const T1 v1_;
13369 const T2 v2_;
13370 const T3 v3_;
13371 const T4 v4_;
13372 const T5 v5_;
13373 const T6 v6_;
13374 const T7 v7_;
13375 const T8 v8_;
13376 const T9 v9_;
13377 const T10 v10_;
13378 const T11 v11_;
13379 const T12 v12_;
13380 const T13 v13_;
13381 const T14 v14_;
13382 const T15 v15_;
13383 const T16 v16_;
13384 const T17 v17_;
13385 const T18 v18_;
13386 const T19 v19_;
13387 const T20 v20_;
13388 const T21 v21_;
13389 const T22 v22_;
13390 const T23 v23_;
13391 const T24 v24_;
13392 const T25 v25_;
13393 const T26 v26_;
13394 const T27 v27_;
13395 const T28 v28_;
13396 const T29 v29_;
13397 const T30 v30_;
13398 const T31 v31_;
13399 const T32 v32_;
13400 const T33 v33_;
13401 const T34 v34_;
13402 const T35 v35_;
13403 const T36 v36_;
13404 const T37 v37_;
13405 const T38 v38_;
13406 const T39 v39_;
13407 const T40 v40_;
13408 const T41 v41_;
13409 const T42 v42_;
13410 const T43 v43_;
13411 const T44 v44_;
13412 const T45 v45_;
13413 const T46 v46_;
13414};
13415
13416template <typename T1, typename T2, typename T3, typename T4, typename T5,
13417 typename T6, typename T7, typename T8, typename T9, typename T10,
13418 typename T11, typename T12, typename T13, typename T14, typename T15,
13419 typename T16, typename T17, typename T18, typename T19, typename T20,
13420 typename T21, typename T22, typename T23, typename T24, typename T25,
13421 typename T26, typename T27, typename T28, typename T29, typename T30,
13422 typename T31, typename T32, typename T33, typename T34, typename T35,
13423 typename T36, typename T37, typename T38, typename T39, typename T40,
13424 typename T41, typename T42, typename T43, typename T44, typename T45,
13425 typename T46, typename T47>
13426class ValueArray47 {
13427 public:
13428 ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13429 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13430 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13431 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13432 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13433 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
13434 v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13435 v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13436 v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13437 v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13438 v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13439 v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13440 v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
13441 v47_(v47) {}
13442
13443 template <typename T>
13444 operator ParamGenerator<T>() const {
13445 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13446 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13447 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13448 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13449 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13450 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13451 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13452 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13453 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13454 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13455 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13456 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13457 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13458 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13459 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13460 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
13461 return ValuesIn(array);
13462 }
13463
13464 private:
13465 // No implementation - assignment is unsupported.
13466 void operator=(const ValueArray47& other);
13467
13468 const T1 v1_;
13469 const T2 v2_;
13470 const T3 v3_;
13471 const T4 v4_;
13472 const T5 v5_;
13473 const T6 v6_;
13474 const T7 v7_;
13475 const T8 v8_;
13476 const T9 v9_;
13477 const T10 v10_;
13478 const T11 v11_;
13479 const T12 v12_;
13480 const T13 v13_;
13481 const T14 v14_;
13482 const T15 v15_;
13483 const T16 v16_;
13484 const T17 v17_;
13485 const T18 v18_;
13486 const T19 v19_;
13487 const T20 v20_;
13488 const T21 v21_;
13489 const T22 v22_;
13490 const T23 v23_;
13491 const T24 v24_;
13492 const T25 v25_;
13493 const T26 v26_;
13494 const T27 v27_;
13495 const T28 v28_;
13496 const T29 v29_;
13497 const T30 v30_;
13498 const T31 v31_;
13499 const T32 v32_;
13500 const T33 v33_;
13501 const T34 v34_;
13502 const T35 v35_;
13503 const T36 v36_;
13504 const T37 v37_;
13505 const T38 v38_;
13506 const T39 v39_;
13507 const T40 v40_;
13508 const T41 v41_;
13509 const T42 v42_;
13510 const T43 v43_;
13511 const T44 v44_;
13512 const T45 v45_;
13513 const T46 v46_;
13514 const T47 v47_;
13515};
13516
13517template <typename T1, typename T2, typename T3, typename T4, typename T5,
13518 typename T6, typename T7, typename T8, typename T9, typename T10,
13519 typename T11, typename T12, typename T13, typename T14, typename T15,
13520 typename T16, typename T17, typename T18, typename T19, typename T20,
13521 typename T21, typename T22, typename T23, typename T24, typename T25,
13522 typename T26, typename T27, typename T28, typename T29, typename T30,
13523 typename T31, typename T32, typename T33, typename T34, typename T35,
13524 typename T36, typename T37, typename T38, typename T39, typename T40,
13525 typename T41, typename T42, typename T43, typename T44, typename T45,
13526 typename T46, typename T47, typename T48>
13527class ValueArray48 {
13528 public:
13529 ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13530 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13531 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13532 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13533 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13534 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
13535 v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13536 v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13537 v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13538 v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13539 v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
13540 v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
13541 v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
13542 v46_(v46), v47_(v47), v48_(v48) {}
13543
13544 template <typename T>
13545 operator ParamGenerator<T>() const {
13546 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13547 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13548 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13549 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13550 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13551 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13552 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13553 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13554 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13555 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13556 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13557 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13558 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13559 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13560 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13561 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13562 static_cast<T>(v48_)};
13563 return ValuesIn(array);
13564 }
13565
13566 private:
13567 // No implementation - assignment is unsupported.
13568 void operator=(const ValueArray48& other);
13569
13570 const T1 v1_;
13571 const T2 v2_;
13572 const T3 v3_;
13573 const T4 v4_;
13574 const T5 v5_;
13575 const T6 v6_;
13576 const T7 v7_;
13577 const T8 v8_;
13578 const T9 v9_;
13579 const T10 v10_;
13580 const T11 v11_;
13581 const T12 v12_;
13582 const T13 v13_;
13583 const T14 v14_;
13584 const T15 v15_;
13585 const T16 v16_;
13586 const T17 v17_;
13587 const T18 v18_;
13588 const T19 v19_;
13589 const T20 v20_;
13590 const T21 v21_;
13591 const T22 v22_;
13592 const T23 v23_;
13593 const T24 v24_;
13594 const T25 v25_;
13595 const T26 v26_;
13596 const T27 v27_;
13597 const T28 v28_;
13598 const T29 v29_;
13599 const T30 v30_;
13600 const T31 v31_;
13601 const T32 v32_;
13602 const T33 v33_;
13603 const T34 v34_;
13604 const T35 v35_;
13605 const T36 v36_;
13606 const T37 v37_;
13607 const T38 v38_;
13608 const T39 v39_;
13609 const T40 v40_;
13610 const T41 v41_;
13611 const T42 v42_;
13612 const T43 v43_;
13613 const T44 v44_;
13614 const T45 v45_;
13615 const T46 v46_;
13616 const T47 v47_;
13617 const T48 v48_;
13618};
13619
13620template <typename T1, typename T2, typename T3, typename T4, typename T5,
13621 typename T6, typename T7, typename T8, typename T9, typename T10,
13622 typename T11, typename T12, typename T13, typename T14, typename T15,
13623 typename T16, typename T17, typename T18, typename T19, typename T20,
13624 typename T21, typename T22, typename T23, typename T24, typename T25,
13625 typename T26, typename T27, typename T28, typename T29, typename T30,
13626 typename T31, typename T32, typename T33, typename T34, typename T35,
13627 typename T36, typename T37, typename T38, typename T39, typename T40,
13628 typename T41, typename T42, typename T43, typename T44, typename T45,
13629 typename T46, typename T47, typename T48, typename T49>
13630class ValueArray49 {
13631 public:
13632 ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13633 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13634 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13635 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13636 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13637 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
13638 T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13639 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13640 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13641 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13642 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13643 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13644 v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13645 v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
13646
13647 template <typename T>
13648 operator ParamGenerator<T>() const {
13649 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13650 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13651 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13652 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13653 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13654 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13655 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13656 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13657 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13658 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13659 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13660 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13661 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13662 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13663 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13664 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13665 static_cast<T>(v48_), static_cast<T>(v49_)};
13666 return ValuesIn(array);
13667 }
13668
13669 private:
13670 // No implementation - assignment is unsupported.
13671 void operator=(const ValueArray49& other);
13672
13673 const T1 v1_;
13674 const T2 v2_;
13675 const T3 v3_;
13676 const T4 v4_;
13677 const T5 v5_;
13678 const T6 v6_;
13679 const T7 v7_;
13680 const T8 v8_;
13681 const T9 v9_;
13682 const T10 v10_;
13683 const T11 v11_;
13684 const T12 v12_;
13685 const T13 v13_;
13686 const T14 v14_;
13687 const T15 v15_;
13688 const T16 v16_;
13689 const T17 v17_;
13690 const T18 v18_;
13691 const T19 v19_;
13692 const T20 v20_;
13693 const T21 v21_;
13694 const T22 v22_;
13695 const T23 v23_;
13696 const T24 v24_;
13697 const T25 v25_;
13698 const T26 v26_;
13699 const T27 v27_;
13700 const T28 v28_;
13701 const T29 v29_;
13702 const T30 v30_;
13703 const T31 v31_;
13704 const T32 v32_;
13705 const T33 v33_;
13706 const T34 v34_;
13707 const T35 v35_;
13708 const T36 v36_;
13709 const T37 v37_;
13710 const T38 v38_;
13711 const T39 v39_;
13712 const T40 v40_;
13713 const T41 v41_;
13714 const T42 v42_;
13715 const T43 v43_;
13716 const T44 v44_;
13717 const T45 v45_;
13718 const T46 v46_;
13719 const T47 v47_;
13720 const T48 v48_;
13721 const T49 v49_;
13722};
13723
13724template <typename T1, typename T2, typename T3, typename T4, typename T5,
13725 typename T6, typename T7, typename T8, typename T9, typename T10,
13726 typename T11, typename T12, typename T13, typename T14, typename T15,
13727 typename T16, typename T17, typename T18, typename T19, typename T20,
13728 typename T21, typename T22, typename T23, typename T24, typename T25,
13729 typename T26, typename T27, typename T28, typename T29, typename T30,
13730 typename T31, typename T32, typename T33, typename T34, typename T35,
13731 typename T36, typename T37, typename T38, typename T39, typename T40,
13732 typename T41, typename T42, typename T43, typename T44, typename T45,
13733 typename T46, typename T47, typename T48, typename T49, typename T50>
13734class ValueArray50 {
13735 public:
13736 ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13737 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13738 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13739 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13740 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13741 T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
13742 T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13743 v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13744 v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13745 v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13746 v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13747 v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13748 v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13749 v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
13750
13751 template <typename T>
13752 operator ParamGenerator<T>() const {
13753 const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13754 static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13755 static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13756 static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13757 static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13758 static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13759 static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13760 static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13761 static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13762 static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13763 static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13764 static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13765 static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13766 static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13767 static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13768 static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13769 static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
13770 return ValuesIn(array);
13771 }
13772
13773 private:
13774 // No implementation - assignment is unsupported.
13775 void operator=(const ValueArray50& other);
13776
13777 const T1 v1_;
13778 const T2 v2_;
13779 const T3 v3_;
13780 const T4 v4_;
13781 const T5 v5_;
13782 const T6 v6_;
13783 const T7 v7_;
13784 const T8 v8_;
13785 const T9 v9_;
13786 const T10 v10_;
13787 const T11 v11_;
13788 const T12 v12_;
13789 const T13 v13_;
13790 const T14 v14_;
13791 const T15 v15_;
13792 const T16 v16_;
13793 const T17 v17_;
13794 const T18 v18_;
13795 const T19 v19_;
13796 const T20 v20_;
13797 const T21 v21_;
13798 const T22 v22_;
13799 const T23 v23_;
13800 const T24 v24_;
13801 const T25 v25_;
13802 const T26 v26_;
13803 const T27 v27_;
13804 const T28 v28_;
13805 const T29 v29_;
13806 const T30 v30_;
13807 const T31 v31_;
13808 const T32 v32_;
13809 const T33 v33_;
13810 const T34 v34_;
13811 const T35 v35_;
13812 const T36 v36_;
13813 const T37 v37_;
13814 const T38 v38_;
13815 const T39 v39_;
13816 const T40 v40_;
13817 const T41 v41_;
13818 const T42 v42_;
13819 const T43 v43_;
13820 const T44 v44_;
13821 const T45 v45_;
13822 const T46 v46_;
13823 const T47 v47_;
13824 const T48 v48_;
13825 const T49 v49_;
13826 const T50 v50_;
13827};
13828
13829# if GTEST_HAS_COMBINE
13830// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
13831//
13832// Generates values from the Cartesian product of values produced
13833// by the argument generators.
13834//
13835template <typename T1, typename T2>
13836class CartesianProductGenerator2
13837 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
13838 public:
13839 typedef ::std::tr1::tuple<T1, T2> ParamType;
13840
13841 CartesianProductGenerator2(const ParamGenerator<T1>& g1,
13842 const ParamGenerator<T2>& g2)
13843 : g1_(g1), g2_(g2) {}
13844 virtual ~CartesianProductGenerator2() {}
13845
13846 virtual ParamIteratorInterface<ParamType>* Begin() const {
13847 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
13848 }
13849 virtual ParamIteratorInterface<ParamType>* End() const {
13850 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
13851 }
13852
13853 private:
13854 class Iterator : public ParamIteratorInterface<ParamType> {
13855 public:
13856 Iterator(const ParamGeneratorInterface<ParamType>* base,
13857 const ParamGenerator<T1>& g1,
13858 const typename ParamGenerator<T1>::iterator& current1,
13859 const ParamGenerator<T2>& g2,
13860 const typename ParamGenerator<T2>::iterator& current2)
13861 : base_(base),
13862 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13863 begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
13864 ComputeCurrentValue();
13865 }
13866 virtual ~Iterator() {}
13867
13868 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13869 return base_;
13870 }
13871 // Advance should not be called on beyond-of-range iterators
13872 // so no component iterators must be beyond end of range, either.
13873 virtual void Advance() {
13874 assert(!AtEnd());
13875 ++current2_;
13876 if (current2_ == end2_) {
13877 current2_ = begin2_;
13878 ++current1_;
13879 }
13880 ComputeCurrentValue();
13881 }
13882 virtual ParamIteratorInterface<ParamType>* Clone() const {
13883 return new Iterator(*this);
13884 }
13885 virtual const ParamType* Current() const { return &current_value_; }
13886 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13887 // Having the same base generator guarantees that the other
13888 // iterator is of the same type and we can downcast.
13889 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13890 << "The program attempted to compare iterators "
13891 << "from different generators." << std::endl;
13892 const Iterator* typed_other =
13893 CheckedDowncastToActualType<const Iterator>(&other);
13894 // We must report iterators equal if they both point beyond their
13895 // respective ranges. That can happen in a variety of fashions,
13896 // so we have to consult AtEnd().
13897 return (AtEnd() && typed_other->AtEnd()) ||
13898 (
13899 current1_ == typed_other->current1_ &&
13900 current2_ == typed_other->current2_);
13901 }
13902
13903 private:
13904 Iterator(const Iterator& other)
13905 : base_(other.base_),
13906 begin1_(other.begin1_),
13907 end1_(other.end1_),
13908 current1_(other.current1_),
13909 begin2_(other.begin2_),
13910 end2_(other.end2_),
13911 current2_(other.current2_) {
13912 ComputeCurrentValue();
13913 }
13914
13915 void ComputeCurrentValue() {
13916 if (!AtEnd())
13917 current_value_ = ParamType(*current1_, *current2_);
13918 }
13919 bool AtEnd() const {
13920 // We must report iterator past the end of the range when either of the
13921 // component iterators has reached the end of its range.
13922 return
13923 current1_ == end1_ ||
13924 current2_ == end2_;
13925 }
13926
13927 // No implementation - assignment is unsupported.
13928 void operator=(const Iterator& other);
13929
13930 const ParamGeneratorInterface<ParamType>* const base_;
13931 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13932 // current[i]_ is the actual traversing iterator.
13933 const typename ParamGenerator<T1>::iterator begin1_;
13934 const typename ParamGenerator<T1>::iterator end1_;
13935 typename ParamGenerator<T1>::iterator current1_;
13936 const typename ParamGenerator<T2>::iterator begin2_;
13937 const typename ParamGenerator<T2>::iterator end2_;
13938 typename ParamGenerator<T2>::iterator current2_;
13939 ParamType current_value_;
13940 }; // class CartesianProductGenerator2::Iterator
13941
13942 // No implementation - assignment is unsupported.
13943 void operator=(const CartesianProductGenerator2& other);
13944
13945 const ParamGenerator<T1> g1_;
13946 const ParamGenerator<T2> g2_;
13947}; // class CartesianProductGenerator2
13948
13949
13950template <typename T1, typename T2, typename T3>
13951class CartesianProductGenerator3
13952 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
13953 public:
13954 typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
13955
13956 CartesianProductGenerator3(const ParamGenerator<T1>& g1,
13957 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
13958 : g1_(g1), g2_(g2), g3_(g3) {}
13959 virtual ~CartesianProductGenerator3() {}
13960
13961 virtual ParamIteratorInterface<ParamType>* Begin() const {
13962 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13963 g3_.begin());
13964 }
13965 virtual ParamIteratorInterface<ParamType>* End() const {
13966 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
13967 }
13968
13969 private:
13970 class Iterator : public ParamIteratorInterface<ParamType> {
13971 public:
13972 Iterator(const ParamGeneratorInterface<ParamType>* base,
13973 const ParamGenerator<T1>& g1,
13974 const typename ParamGenerator<T1>::iterator& current1,
13975 const ParamGenerator<T2>& g2,
13976 const typename ParamGenerator<T2>::iterator& current2,
13977 const ParamGenerator<T3>& g3,
13978 const typename ParamGenerator<T3>::iterator& current3)
13979 : base_(base),
13980 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13981 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13982 begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
13983 ComputeCurrentValue();
13984 }
13985 virtual ~Iterator() {}
13986
13987 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13988 return base_;
13989 }
13990 // Advance should not be called on beyond-of-range iterators
13991 // so no component iterators must be beyond end of range, either.
13992 virtual void Advance() {
13993 assert(!AtEnd());
13994 ++current3_;
13995 if (current3_ == end3_) {
13996 current3_ = begin3_;
13997 ++current2_;
13998 }
13999 if (current2_ == end2_) {
14000 current2_ = begin2_;
14001 ++current1_;
14002 }
14003 ComputeCurrentValue();
14004 }
14005 virtual ParamIteratorInterface<ParamType>* Clone() const {
14006 return new Iterator(*this);
14007 }
14008 virtual const ParamType* Current() const { return &current_value_; }
14009 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14010 // Having the same base generator guarantees that the other
14011 // iterator is of the same type and we can downcast.
14012 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14013 << "The program attempted to compare iterators "
14014 << "from different generators." << std::endl;
14015 const Iterator* typed_other =
14016 CheckedDowncastToActualType<const Iterator>(&other);
14017 // We must report iterators equal if they both point beyond their
14018 // respective ranges. That can happen in a variety of fashions,
14019 // so we have to consult AtEnd().
14020 return (AtEnd() && typed_other->AtEnd()) ||
14021 (
14022 current1_ == typed_other->current1_ &&
14023 current2_ == typed_other->current2_ &&
14024 current3_ == typed_other->current3_);
14025 }
14026
14027 private:
14028 Iterator(const Iterator& other)
14029 : base_(other.base_),
14030 begin1_(other.begin1_),
14031 end1_(other.end1_),
14032 current1_(other.current1_),
14033 begin2_(other.begin2_),
14034 end2_(other.end2_),
14035 current2_(other.current2_),
14036 begin3_(other.begin3_),
14037 end3_(other.end3_),
14038 current3_(other.current3_) {
14039 ComputeCurrentValue();
14040 }
14041
14042 void ComputeCurrentValue() {
14043 if (!AtEnd())
14044 current_value_ = ParamType(*current1_, *current2_, *current3_);
14045 }
14046 bool AtEnd() const {
14047 // We must report iterator past the end of the range when either of the
14048 // component iterators has reached the end of its range.
14049 return
14050 current1_ == end1_ ||
14051 current2_ == end2_ ||
14052 current3_ == end3_;
14053 }
14054
14055 // No implementation - assignment is unsupported.
14056 void operator=(const Iterator& other);
14057
14058 const ParamGeneratorInterface<ParamType>* const base_;
14059 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14060 // current[i]_ is the actual traversing iterator.
14061 const typename ParamGenerator<T1>::iterator begin1_;
14062 const typename ParamGenerator<T1>::iterator end1_;
14063 typename ParamGenerator<T1>::iterator current1_;
14064 const typename ParamGenerator<T2>::iterator begin2_;
14065 const typename ParamGenerator<T2>::iterator end2_;
14066 typename ParamGenerator<T2>::iterator current2_;
14067 const typename ParamGenerator<T3>::iterator begin3_;
14068 const typename ParamGenerator<T3>::iterator end3_;
14069 typename ParamGenerator<T3>::iterator current3_;
14070 ParamType current_value_;
14071 }; // class CartesianProductGenerator3::Iterator
14072
14073 // No implementation - assignment is unsupported.
14074 void operator=(const CartesianProductGenerator3& other);
14075
14076 const ParamGenerator<T1> g1_;
14077 const ParamGenerator<T2> g2_;
14078 const ParamGenerator<T3> g3_;
14079}; // class CartesianProductGenerator3
14080
14081
14082template <typename T1, typename T2, typename T3, typename T4>
14083class CartesianProductGenerator4
14084 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
14085 public:
14086 typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
14087
14088 CartesianProductGenerator4(const ParamGenerator<T1>& g1,
14089 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14090 const ParamGenerator<T4>& g4)
14091 : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
14092 virtual ~CartesianProductGenerator4() {}
14093
14094 virtual ParamIteratorInterface<ParamType>* Begin() const {
14095 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14096 g3_.begin(), g4_, g4_.begin());
14097 }
14098 virtual ParamIteratorInterface<ParamType>* End() const {
14099 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14100 g4_, g4_.end());
14101 }
14102
14103 private:
14104 class Iterator : public ParamIteratorInterface<ParamType> {
14105 public:
14106 Iterator(const ParamGeneratorInterface<ParamType>* base,
14107 const ParamGenerator<T1>& g1,
14108 const typename ParamGenerator<T1>::iterator& current1,
14109 const ParamGenerator<T2>& g2,
14110 const typename ParamGenerator<T2>::iterator& current2,
14111 const ParamGenerator<T3>& g3,
14112 const typename ParamGenerator<T3>::iterator& current3,
14113 const ParamGenerator<T4>& g4,
14114 const typename ParamGenerator<T4>::iterator& current4)
14115 : base_(base),
14116 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14117 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14118 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14119 begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
14120 ComputeCurrentValue();
14121 }
14122 virtual ~Iterator() {}
14123
14124 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14125 return base_;
14126 }
14127 // Advance should not be called on beyond-of-range iterators
14128 // so no component iterators must be beyond end of range, either.
14129 virtual void Advance() {
14130 assert(!AtEnd());
14131 ++current4_;
14132 if (current4_ == end4_) {
14133 current4_ = begin4_;
14134 ++current3_;
14135 }
14136 if (current3_ == end3_) {
14137 current3_ = begin3_;
14138 ++current2_;
14139 }
14140 if (current2_ == end2_) {
14141 current2_ = begin2_;
14142 ++current1_;
14143 }
14144 ComputeCurrentValue();
14145 }
14146 virtual ParamIteratorInterface<ParamType>* Clone() const {
14147 return new Iterator(*this);
14148 }
14149 virtual const ParamType* Current() const { return &current_value_; }
14150 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14151 // Having the same base generator guarantees that the other
14152 // iterator is of the same type and we can downcast.
14153 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14154 << "The program attempted to compare iterators "
14155 << "from different generators." << std::endl;
14156 const Iterator* typed_other =
14157 CheckedDowncastToActualType<const Iterator>(&other);
14158 // We must report iterators equal if they both point beyond their
14159 // respective ranges. That can happen in a variety of fashions,
14160 // so we have to consult AtEnd().
14161 return (AtEnd() && typed_other->AtEnd()) ||
14162 (
14163 current1_ == typed_other->current1_ &&
14164 current2_ == typed_other->current2_ &&
14165 current3_ == typed_other->current3_ &&
14166 current4_ == typed_other->current4_);
14167 }
14168
14169 private:
14170 Iterator(const Iterator& other)
14171 : base_(other.base_),
14172 begin1_(other.begin1_),
14173 end1_(other.end1_),
14174 current1_(other.current1_),
14175 begin2_(other.begin2_),
14176 end2_(other.end2_),
14177 current2_(other.current2_),
14178 begin3_(other.begin3_),
14179 end3_(other.end3_),
14180 current3_(other.current3_),
14181 begin4_(other.begin4_),
14182 end4_(other.end4_),
14183 current4_(other.current4_) {
14184 ComputeCurrentValue();
14185 }
14186
14187 void ComputeCurrentValue() {
14188 if (!AtEnd())
14189 current_value_ = ParamType(*current1_, *current2_, *current3_,
14190 *current4_);
14191 }
14192 bool AtEnd() const {
14193 // We must report iterator past the end of the range when either of the
14194 // component iterators has reached the end of its range.
14195 return
14196 current1_ == end1_ ||
14197 current2_ == end2_ ||
14198 current3_ == end3_ ||
14199 current4_ == end4_;
14200 }
14201
14202 // No implementation - assignment is unsupported.
14203 void operator=(const Iterator& other);
14204
14205 const ParamGeneratorInterface<ParamType>* const base_;
14206 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14207 // current[i]_ is the actual traversing iterator.
14208 const typename ParamGenerator<T1>::iterator begin1_;
14209 const typename ParamGenerator<T1>::iterator end1_;
14210 typename ParamGenerator<T1>::iterator current1_;
14211 const typename ParamGenerator<T2>::iterator begin2_;
14212 const typename ParamGenerator<T2>::iterator end2_;
14213 typename ParamGenerator<T2>::iterator current2_;
14214 const typename ParamGenerator<T3>::iterator begin3_;
14215 const typename ParamGenerator<T3>::iterator end3_;
14216 typename ParamGenerator<T3>::iterator current3_;
14217 const typename ParamGenerator<T4>::iterator begin4_;
14218 const typename ParamGenerator<T4>::iterator end4_;
14219 typename ParamGenerator<T4>::iterator current4_;
14220 ParamType current_value_;
14221 }; // class CartesianProductGenerator4::Iterator
14222
14223 // No implementation - assignment is unsupported.
14224 void operator=(const CartesianProductGenerator4& other);
14225
14226 const ParamGenerator<T1> g1_;
14227 const ParamGenerator<T2> g2_;
14228 const ParamGenerator<T3> g3_;
14229 const ParamGenerator<T4> g4_;
14230}; // class CartesianProductGenerator4
14231
14232
14233template <typename T1, typename T2, typename T3, typename T4, typename T5>
14234class CartesianProductGenerator5
14235 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
14236 public:
14237 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
14238
14239 CartesianProductGenerator5(const ParamGenerator<T1>& g1,
14240 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14241 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
14242 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
14243 virtual ~CartesianProductGenerator5() {}
14244
14245 virtual ParamIteratorInterface<ParamType>* Begin() const {
14246 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14247 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
14248 }
14249 virtual ParamIteratorInterface<ParamType>* End() const {
14250 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14251 g4_, g4_.end(), g5_, g5_.end());
14252 }
14253
14254 private:
14255 class Iterator : public ParamIteratorInterface<ParamType> {
14256 public:
14257 Iterator(const ParamGeneratorInterface<ParamType>* base,
14258 const ParamGenerator<T1>& g1,
14259 const typename ParamGenerator<T1>::iterator& current1,
14260 const ParamGenerator<T2>& g2,
14261 const typename ParamGenerator<T2>::iterator& current2,
14262 const ParamGenerator<T3>& g3,
14263 const typename ParamGenerator<T3>::iterator& current3,
14264 const ParamGenerator<T4>& g4,
14265 const typename ParamGenerator<T4>::iterator& current4,
14266 const ParamGenerator<T5>& g5,
14267 const typename ParamGenerator<T5>::iterator& current5)
14268 : base_(base),
14269 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14270 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14271 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14272 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14273 begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
14274 ComputeCurrentValue();
14275 }
14276 virtual ~Iterator() {}
14277
14278 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14279 return base_;
14280 }
14281 // Advance should not be called on beyond-of-range iterators
14282 // so no component iterators must be beyond end of range, either.
14283 virtual void Advance() {
14284 assert(!AtEnd());
14285 ++current5_;
14286 if (current5_ == end5_) {
14287 current5_ = begin5_;
14288 ++current4_;
14289 }
14290 if (current4_ == end4_) {
14291 current4_ = begin4_;
14292 ++current3_;
14293 }
14294 if (current3_ == end3_) {
14295 current3_ = begin3_;
14296 ++current2_;
14297 }
14298 if (current2_ == end2_) {
14299 current2_ = begin2_;
14300 ++current1_;
14301 }
14302 ComputeCurrentValue();
14303 }
14304 virtual ParamIteratorInterface<ParamType>* Clone() const {
14305 return new Iterator(*this);
14306 }
14307 virtual const ParamType* Current() const { return &current_value_; }
14308 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14309 // Having the same base generator guarantees that the other
14310 // iterator is of the same type and we can downcast.
14311 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14312 << "The program attempted to compare iterators "
14313 << "from different generators." << std::endl;
14314 const Iterator* typed_other =
14315 CheckedDowncastToActualType<const Iterator>(&other);
14316 // We must report iterators equal if they both point beyond their
14317 // respective ranges. That can happen in a variety of fashions,
14318 // so we have to consult AtEnd().
14319 return (AtEnd() && typed_other->AtEnd()) ||
14320 (
14321 current1_ == typed_other->current1_ &&
14322 current2_ == typed_other->current2_ &&
14323 current3_ == typed_other->current3_ &&
14324 current4_ == typed_other->current4_ &&
14325 current5_ == typed_other->current5_);
14326 }
14327
14328 private:
14329 Iterator(const Iterator& other)
14330 : base_(other.base_),
14331 begin1_(other.begin1_),
14332 end1_(other.end1_),
14333 current1_(other.current1_),
14334 begin2_(other.begin2_),
14335 end2_(other.end2_),
14336 current2_(other.current2_),
14337 begin3_(other.begin3_),
14338 end3_(other.end3_),
14339 current3_(other.current3_),
14340 begin4_(other.begin4_),
14341 end4_(other.end4_),
14342 current4_(other.current4_),
14343 begin5_(other.begin5_),
14344 end5_(other.end5_),
14345 current5_(other.current5_) {
14346 ComputeCurrentValue();
14347 }
14348
14349 void ComputeCurrentValue() {
14350 if (!AtEnd())
14351 current_value_ = ParamType(*current1_, *current2_, *current3_,
14352 *current4_, *current5_);
14353 }
14354 bool AtEnd() const {
14355 // We must report iterator past the end of the range when either of the
14356 // component iterators has reached the end of its range.
14357 return
14358 current1_ == end1_ ||
14359 current2_ == end2_ ||
14360 current3_ == end3_ ||
14361 current4_ == end4_ ||
14362 current5_ == end5_;
14363 }
14364
14365 // No implementation - assignment is unsupported.
14366 void operator=(const Iterator& other);
14367
14368 const ParamGeneratorInterface<ParamType>* const base_;
14369 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14370 // current[i]_ is the actual traversing iterator.
14371 const typename ParamGenerator<T1>::iterator begin1_;
14372 const typename ParamGenerator<T1>::iterator end1_;
14373 typename ParamGenerator<T1>::iterator current1_;
14374 const typename ParamGenerator<T2>::iterator begin2_;
14375 const typename ParamGenerator<T2>::iterator end2_;
14376 typename ParamGenerator<T2>::iterator current2_;
14377 const typename ParamGenerator<T3>::iterator begin3_;
14378 const typename ParamGenerator<T3>::iterator end3_;
14379 typename ParamGenerator<T3>::iterator current3_;
14380 const typename ParamGenerator<T4>::iterator begin4_;
14381 const typename ParamGenerator<T4>::iterator end4_;
14382 typename ParamGenerator<T4>::iterator current4_;
14383 const typename ParamGenerator<T5>::iterator begin5_;
14384 const typename ParamGenerator<T5>::iterator end5_;
14385 typename ParamGenerator<T5>::iterator current5_;
14386 ParamType current_value_;
14387 }; // class CartesianProductGenerator5::Iterator
14388
14389 // No implementation - assignment is unsupported.
14390 void operator=(const CartesianProductGenerator5& other);
14391
14392 const ParamGenerator<T1> g1_;
14393 const ParamGenerator<T2> g2_;
14394 const ParamGenerator<T3> g3_;
14395 const ParamGenerator<T4> g4_;
14396 const ParamGenerator<T5> g5_;
14397}; // class CartesianProductGenerator5
14398
14399
14400template <typename T1, typename T2, typename T3, typename T4, typename T5,
14401 typename T6>
14402class CartesianProductGenerator6
14403 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
14404 T6> > {
14405 public:
14406 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
14407
14408 CartesianProductGenerator6(const ParamGenerator<T1>& g1,
14409 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14410 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14411 const ParamGenerator<T6>& g6)
14412 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
14413 virtual ~CartesianProductGenerator6() {}
14414
14415 virtual ParamIteratorInterface<ParamType>* Begin() const {
14416 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14417 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
14418 }
14419 virtual ParamIteratorInterface<ParamType>* End() const {
14420 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14421 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
14422 }
14423
14424 private:
14425 class Iterator : public ParamIteratorInterface<ParamType> {
14426 public:
14427 Iterator(const ParamGeneratorInterface<ParamType>* base,
14428 const ParamGenerator<T1>& g1,
14429 const typename ParamGenerator<T1>::iterator& current1,
14430 const ParamGenerator<T2>& g2,
14431 const typename ParamGenerator<T2>::iterator& current2,
14432 const ParamGenerator<T3>& g3,
14433 const typename ParamGenerator<T3>::iterator& current3,
14434 const ParamGenerator<T4>& g4,
14435 const typename ParamGenerator<T4>::iterator& current4,
14436 const ParamGenerator<T5>& g5,
14437 const typename ParamGenerator<T5>::iterator& current5,
14438 const ParamGenerator<T6>& g6,
14439 const typename ParamGenerator<T6>::iterator& current6)
14440 : base_(base),
14441 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14442 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14443 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14444 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14445 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14446 begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
14447 ComputeCurrentValue();
14448 }
14449 virtual ~Iterator() {}
14450
14451 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14452 return base_;
14453 }
14454 // Advance should not be called on beyond-of-range iterators
14455 // so no component iterators must be beyond end of range, either.
14456 virtual void Advance() {
14457 assert(!AtEnd());
14458 ++current6_;
14459 if (current6_ == end6_) {
14460 current6_ = begin6_;
14461 ++current5_;
14462 }
14463 if (current5_ == end5_) {
14464 current5_ = begin5_;
14465 ++current4_;
14466 }
14467 if (current4_ == end4_) {
14468 current4_ = begin4_;
14469 ++current3_;
14470 }
14471 if (current3_ == end3_) {
14472 current3_ = begin3_;
14473 ++current2_;
14474 }
14475 if (current2_ == end2_) {
14476 current2_ = begin2_;
14477 ++current1_;
14478 }
14479 ComputeCurrentValue();
14480 }
14481 virtual ParamIteratorInterface<ParamType>* Clone() const {
14482 return new Iterator(*this);
14483 }
14484 virtual const ParamType* Current() const { return &current_value_; }
14485 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14486 // Having the same base generator guarantees that the other
14487 // iterator is of the same type and we can downcast.
14488 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14489 << "The program attempted to compare iterators "
14490 << "from different generators." << std::endl;
14491 const Iterator* typed_other =
14492 CheckedDowncastToActualType<const Iterator>(&other);
14493 // We must report iterators equal if they both point beyond their
14494 // respective ranges. That can happen in a variety of fashions,
14495 // so we have to consult AtEnd().
14496 return (AtEnd() && typed_other->AtEnd()) ||
14497 (
14498 current1_ == typed_other->current1_ &&
14499 current2_ == typed_other->current2_ &&
14500 current3_ == typed_other->current3_ &&
14501 current4_ == typed_other->current4_ &&
14502 current5_ == typed_other->current5_ &&
14503 current6_ == typed_other->current6_);
14504 }
14505
14506 private:
14507 Iterator(const Iterator& other)
14508 : base_(other.base_),
14509 begin1_(other.begin1_),
14510 end1_(other.end1_),
14511 current1_(other.current1_),
14512 begin2_(other.begin2_),
14513 end2_(other.end2_),
14514 current2_(other.current2_),
14515 begin3_(other.begin3_),
14516 end3_(other.end3_),
14517 current3_(other.current3_),
14518 begin4_(other.begin4_),
14519 end4_(other.end4_),
14520 current4_(other.current4_),
14521 begin5_(other.begin5_),
14522 end5_(other.end5_),
14523 current5_(other.current5_),
14524 begin6_(other.begin6_),
14525 end6_(other.end6_),
14526 current6_(other.current6_) {
14527 ComputeCurrentValue();
14528 }
14529
14530 void ComputeCurrentValue() {
14531 if (!AtEnd())
14532 current_value_ = ParamType(*current1_, *current2_, *current3_,
14533 *current4_, *current5_, *current6_);
14534 }
14535 bool AtEnd() const {
14536 // We must report iterator past the end of the range when either of the
14537 // component iterators has reached the end of its range.
14538 return
14539 current1_ == end1_ ||
14540 current2_ == end2_ ||
14541 current3_ == end3_ ||
14542 current4_ == end4_ ||
14543 current5_ == end5_ ||
14544 current6_ == end6_;
14545 }
14546
14547 // No implementation - assignment is unsupported.
14548 void operator=(const Iterator& other);
14549
14550 const ParamGeneratorInterface<ParamType>* const base_;
14551 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14552 // current[i]_ is the actual traversing iterator.
14553 const typename ParamGenerator<T1>::iterator begin1_;
14554 const typename ParamGenerator<T1>::iterator end1_;
14555 typename ParamGenerator<T1>::iterator current1_;
14556 const typename ParamGenerator<T2>::iterator begin2_;
14557 const typename ParamGenerator<T2>::iterator end2_;
14558 typename ParamGenerator<T2>::iterator current2_;
14559 const typename ParamGenerator<T3>::iterator begin3_;
14560 const typename ParamGenerator<T3>::iterator end3_;
14561 typename ParamGenerator<T3>::iterator current3_;
14562 const typename ParamGenerator<T4>::iterator begin4_;
14563 const typename ParamGenerator<T4>::iterator end4_;
14564 typename ParamGenerator<T4>::iterator current4_;
14565 const typename ParamGenerator<T5>::iterator begin5_;
14566 const typename ParamGenerator<T5>::iterator end5_;
14567 typename ParamGenerator<T5>::iterator current5_;
14568 const typename ParamGenerator<T6>::iterator begin6_;
14569 const typename ParamGenerator<T6>::iterator end6_;
14570 typename ParamGenerator<T6>::iterator current6_;
14571 ParamType current_value_;
14572 }; // class CartesianProductGenerator6::Iterator
14573
14574 // No implementation - assignment is unsupported.
14575 void operator=(const CartesianProductGenerator6& other);
14576
14577 const ParamGenerator<T1> g1_;
14578 const ParamGenerator<T2> g2_;
14579 const ParamGenerator<T3> g3_;
14580 const ParamGenerator<T4> g4_;
14581 const ParamGenerator<T5> g5_;
14582 const ParamGenerator<T6> g6_;
14583}; // class CartesianProductGenerator6
14584
14585
14586template <typename T1, typename T2, typename T3, typename T4, typename T5,
14587 typename T6, typename T7>
14588class CartesianProductGenerator7
14589 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14590 T7> > {
14591 public:
14592 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
14593
14594 CartesianProductGenerator7(const ParamGenerator<T1>& g1,
14595 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14596 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14597 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
14598 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
14599 virtual ~CartesianProductGenerator7() {}
14600
14601 virtual ParamIteratorInterface<ParamType>* Begin() const {
14602 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14603 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14604 g7_.begin());
14605 }
14606 virtual ParamIteratorInterface<ParamType>* End() const {
14607 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14608 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
14609 }
14610
14611 private:
14612 class Iterator : public ParamIteratorInterface<ParamType> {
14613 public:
14614 Iterator(const ParamGeneratorInterface<ParamType>* base,
14615 const ParamGenerator<T1>& g1,
14616 const typename ParamGenerator<T1>::iterator& current1,
14617 const ParamGenerator<T2>& g2,
14618 const typename ParamGenerator<T2>::iterator& current2,
14619 const ParamGenerator<T3>& g3,
14620 const typename ParamGenerator<T3>::iterator& current3,
14621 const ParamGenerator<T4>& g4,
14622 const typename ParamGenerator<T4>::iterator& current4,
14623 const ParamGenerator<T5>& g5,
14624 const typename ParamGenerator<T5>::iterator& current5,
14625 const ParamGenerator<T6>& g6,
14626 const typename ParamGenerator<T6>::iterator& current6,
14627 const ParamGenerator<T7>& g7,
14628 const typename ParamGenerator<T7>::iterator& current7)
14629 : base_(base),
14630 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14631 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14632 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14633 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14634 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14635 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14636 begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
14637 ComputeCurrentValue();
14638 }
14639 virtual ~Iterator() {}
14640
14641 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14642 return base_;
14643 }
14644 // Advance should not be called on beyond-of-range iterators
14645 // so no component iterators must be beyond end of range, either.
14646 virtual void Advance() {
14647 assert(!AtEnd());
14648 ++current7_;
14649 if (current7_ == end7_) {
14650 current7_ = begin7_;
14651 ++current6_;
14652 }
14653 if (current6_ == end6_) {
14654 current6_ = begin6_;
14655 ++current5_;
14656 }
14657 if (current5_ == end5_) {
14658 current5_ = begin5_;
14659 ++current4_;
14660 }
14661 if (current4_ == end4_) {
14662 current4_ = begin4_;
14663 ++current3_;
14664 }
14665 if (current3_ == end3_) {
14666 current3_ = begin3_;
14667 ++current2_;
14668 }
14669 if (current2_ == end2_) {
14670 current2_ = begin2_;
14671 ++current1_;
14672 }
14673 ComputeCurrentValue();
14674 }
14675 virtual ParamIteratorInterface<ParamType>* Clone() const {
14676 return new Iterator(*this);
14677 }
14678 virtual const ParamType* Current() const { return &current_value_; }
14679 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14680 // Having the same base generator guarantees that the other
14681 // iterator is of the same type and we can downcast.
14682 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14683 << "The program attempted to compare iterators "
14684 << "from different generators." << std::endl;
14685 const Iterator* typed_other =
14686 CheckedDowncastToActualType<const Iterator>(&other);
14687 // We must report iterators equal if they both point beyond their
14688 // respective ranges. That can happen in a variety of fashions,
14689 // so we have to consult AtEnd().
14690 return (AtEnd() && typed_other->AtEnd()) ||
14691 (
14692 current1_ == typed_other->current1_ &&
14693 current2_ == typed_other->current2_ &&
14694 current3_ == typed_other->current3_ &&
14695 current4_ == typed_other->current4_ &&
14696 current5_ == typed_other->current5_ &&
14697 current6_ == typed_other->current6_ &&
14698 current7_ == typed_other->current7_);
14699 }
14700
14701 private:
14702 Iterator(const Iterator& other)
14703 : base_(other.base_),
14704 begin1_(other.begin1_),
14705 end1_(other.end1_),
14706 current1_(other.current1_),
14707 begin2_(other.begin2_),
14708 end2_(other.end2_),
14709 current2_(other.current2_),
14710 begin3_(other.begin3_),
14711 end3_(other.end3_),
14712 current3_(other.current3_),
14713 begin4_(other.begin4_),
14714 end4_(other.end4_),
14715 current4_(other.current4_),
14716 begin5_(other.begin5_),
14717 end5_(other.end5_),
14718 current5_(other.current5_),
14719 begin6_(other.begin6_),
14720 end6_(other.end6_),
14721 current6_(other.current6_),
14722 begin7_(other.begin7_),
14723 end7_(other.end7_),
14724 current7_(other.current7_) {
14725 ComputeCurrentValue();
14726 }
14727
14728 void ComputeCurrentValue() {
14729 if (!AtEnd())
14730 current_value_ = ParamType(*current1_, *current2_, *current3_,
14731 *current4_, *current5_, *current6_, *current7_);
14732 }
14733 bool AtEnd() const {
14734 // We must report iterator past the end of the range when either of the
14735 // component iterators has reached the end of its range.
14736 return
14737 current1_ == end1_ ||
14738 current2_ == end2_ ||
14739 current3_ == end3_ ||
14740 current4_ == end4_ ||
14741 current5_ == end5_ ||
14742 current6_ == end6_ ||
14743 current7_ == end7_;
14744 }
14745
14746 // No implementation - assignment is unsupported.
14747 void operator=(const Iterator& other);
14748
14749 const ParamGeneratorInterface<ParamType>* const base_;
14750 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14751 // current[i]_ is the actual traversing iterator.
14752 const typename ParamGenerator<T1>::iterator begin1_;
14753 const typename ParamGenerator<T1>::iterator end1_;
14754 typename ParamGenerator<T1>::iterator current1_;
14755 const typename ParamGenerator<T2>::iterator begin2_;
14756 const typename ParamGenerator<T2>::iterator end2_;
14757 typename ParamGenerator<T2>::iterator current2_;
14758 const typename ParamGenerator<T3>::iterator begin3_;
14759 const typename ParamGenerator<T3>::iterator end3_;
14760 typename ParamGenerator<T3>::iterator current3_;
14761 const typename ParamGenerator<T4>::iterator begin4_;
14762 const typename ParamGenerator<T4>::iterator end4_;
14763 typename ParamGenerator<T4>::iterator current4_;
14764 const typename ParamGenerator<T5>::iterator begin5_;
14765 const typename ParamGenerator<T5>::iterator end5_;
14766 typename ParamGenerator<T5>::iterator current5_;
14767 const typename ParamGenerator<T6>::iterator begin6_;
14768 const typename ParamGenerator<T6>::iterator end6_;
14769 typename ParamGenerator<T6>::iterator current6_;
14770 const typename ParamGenerator<T7>::iterator begin7_;
14771 const typename ParamGenerator<T7>::iterator end7_;
14772 typename ParamGenerator<T7>::iterator current7_;
14773 ParamType current_value_;
14774 }; // class CartesianProductGenerator7::Iterator
14775
14776 // No implementation - assignment is unsupported.
14777 void operator=(const CartesianProductGenerator7& other);
14778
14779 const ParamGenerator<T1> g1_;
14780 const ParamGenerator<T2> g2_;
14781 const ParamGenerator<T3> g3_;
14782 const ParamGenerator<T4> g4_;
14783 const ParamGenerator<T5> g5_;
14784 const ParamGenerator<T6> g6_;
14785 const ParamGenerator<T7> g7_;
14786}; // class CartesianProductGenerator7
14787
14788
14789template <typename T1, typename T2, typename T3, typename T4, typename T5,
14790 typename T6, typename T7, typename T8>
14791class CartesianProductGenerator8
14792 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14793 T7, T8> > {
14794 public:
14795 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
14796
14797 CartesianProductGenerator8(const ParamGenerator<T1>& g1,
14798 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14799 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14800 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14801 const ParamGenerator<T8>& g8)
14802 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
14803 g8_(g8) {}
14804 virtual ~CartesianProductGenerator8() {}
14805
14806 virtual ParamIteratorInterface<ParamType>* Begin() const {
14807 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14808 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14809 g7_.begin(), g8_, g8_.begin());
14810 }
14811 virtual ParamIteratorInterface<ParamType>* End() const {
14812 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14813 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14814 g8_.end());
14815 }
14816
14817 private:
14818 class Iterator : public ParamIteratorInterface<ParamType> {
14819 public:
14820 Iterator(const ParamGeneratorInterface<ParamType>* base,
14821 const ParamGenerator<T1>& g1,
14822 const typename ParamGenerator<T1>::iterator& current1,
14823 const ParamGenerator<T2>& g2,
14824 const typename ParamGenerator<T2>::iterator& current2,
14825 const ParamGenerator<T3>& g3,
14826 const typename ParamGenerator<T3>::iterator& current3,
14827 const ParamGenerator<T4>& g4,
14828 const typename ParamGenerator<T4>::iterator& current4,
14829 const ParamGenerator<T5>& g5,
14830 const typename ParamGenerator<T5>::iterator& current5,
14831 const ParamGenerator<T6>& g6,
14832 const typename ParamGenerator<T6>::iterator& current6,
14833 const ParamGenerator<T7>& g7,
14834 const typename ParamGenerator<T7>::iterator& current7,
14835 const ParamGenerator<T8>& g8,
14836 const typename ParamGenerator<T8>::iterator& current8)
14837 : base_(base),
14838 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14839 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14840 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14841 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14842 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14843 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14844 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
14845 begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
14846 ComputeCurrentValue();
14847 }
14848 virtual ~Iterator() {}
14849
14850 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14851 return base_;
14852 }
14853 // Advance should not be called on beyond-of-range iterators
14854 // so no component iterators must be beyond end of range, either.
14855 virtual void Advance() {
14856 assert(!AtEnd());
14857 ++current8_;
14858 if (current8_ == end8_) {
14859 current8_ = begin8_;
14860 ++current7_;
14861 }
14862 if (current7_ == end7_) {
14863 current7_ = begin7_;
14864 ++current6_;
14865 }
14866 if (current6_ == end6_) {
14867 current6_ = begin6_;
14868 ++current5_;
14869 }
14870 if (current5_ == end5_) {
14871 current5_ = begin5_;
14872 ++current4_;
14873 }
14874 if (current4_ == end4_) {
14875 current4_ = begin4_;
14876 ++current3_;
14877 }
14878 if (current3_ == end3_) {
14879 current3_ = begin3_;
14880 ++current2_;
14881 }
14882 if (current2_ == end2_) {
14883 current2_ = begin2_;
14884 ++current1_;
14885 }
14886 ComputeCurrentValue();
14887 }
14888 virtual ParamIteratorInterface<ParamType>* Clone() const {
14889 return new Iterator(*this);
14890 }
14891 virtual const ParamType* Current() const { return &current_value_; }
14892 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14893 // Having the same base generator guarantees that the other
14894 // iterator is of the same type and we can downcast.
14895 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14896 << "The program attempted to compare iterators "
14897 << "from different generators." << std::endl;
14898 const Iterator* typed_other =
14899 CheckedDowncastToActualType<const Iterator>(&other);
14900 // We must report iterators equal if they both point beyond their
14901 // respective ranges. That can happen in a variety of fashions,
14902 // so we have to consult AtEnd().
14903 return (AtEnd() && typed_other->AtEnd()) ||
14904 (
14905 current1_ == typed_other->current1_ &&
14906 current2_ == typed_other->current2_ &&
14907 current3_ == typed_other->current3_ &&
14908 current4_ == typed_other->current4_ &&
14909 current5_ == typed_other->current5_ &&
14910 current6_ == typed_other->current6_ &&
14911 current7_ == typed_other->current7_ &&
14912 current8_ == typed_other->current8_);
14913 }
14914
14915 private:
14916 Iterator(const Iterator& other)
14917 : base_(other.base_),
14918 begin1_(other.begin1_),
14919 end1_(other.end1_),
14920 current1_(other.current1_),
14921 begin2_(other.begin2_),
14922 end2_(other.end2_),
14923 current2_(other.current2_),
14924 begin3_(other.begin3_),
14925 end3_(other.end3_),
14926 current3_(other.current3_),
14927 begin4_(other.begin4_),
14928 end4_(other.end4_),
14929 current4_(other.current4_),
14930 begin5_(other.begin5_),
14931 end5_(other.end5_),
14932 current5_(other.current5_),
14933 begin6_(other.begin6_),
14934 end6_(other.end6_),
14935 current6_(other.current6_),
14936 begin7_(other.begin7_),
14937 end7_(other.end7_),
14938 current7_(other.current7_),
14939 begin8_(other.begin8_),
14940 end8_(other.end8_),
14941 current8_(other.current8_) {
14942 ComputeCurrentValue();
14943 }
14944
14945 void ComputeCurrentValue() {
14946 if (!AtEnd())
14947 current_value_ = ParamType(*current1_, *current2_, *current3_,
14948 *current4_, *current5_, *current6_, *current7_, *current8_);
14949 }
14950 bool AtEnd() const {
14951 // We must report iterator past the end of the range when either of the
14952 // component iterators has reached the end of its range.
14953 return
14954 current1_ == end1_ ||
14955 current2_ == end2_ ||
14956 current3_ == end3_ ||
14957 current4_ == end4_ ||
14958 current5_ == end5_ ||
14959 current6_ == end6_ ||
14960 current7_ == end7_ ||
14961 current8_ == end8_;
14962 }
14963
14964 // No implementation - assignment is unsupported.
14965 void operator=(const Iterator& other);
14966
14967 const ParamGeneratorInterface<ParamType>* const base_;
14968 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14969 // current[i]_ is the actual traversing iterator.
14970 const typename ParamGenerator<T1>::iterator begin1_;
14971 const typename ParamGenerator<T1>::iterator end1_;
14972 typename ParamGenerator<T1>::iterator current1_;
14973 const typename ParamGenerator<T2>::iterator begin2_;
14974 const typename ParamGenerator<T2>::iterator end2_;
14975 typename ParamGenerator<T2>::iterator current2_;
14976 const typename ParamGenerator<T3>::iterator begin3_;
14977 const typename ParamGenerator<T3>::iterator end3_;
14978 typename ParamGenerator<T3>::iterator current3_;
14979 const typename ParamGenerator<T4>::iterator begin4_;
14980 const typename ParamGenerator<T4>::iterator end4_;
14981 typename ParamGenerator<T4>::iterator current4_;
14982 const typename ParamGenerator<T5>::iterator begin5_;
14983 const typename ParamGenerator<T5>::iterator end5_;
14984 typename ParamGenerator<T5>::iterator current5_;
14985 const typename ParamGenerator<T6>::iterator begin6_;
14986 const typename ParamGenerator<T6>::iterator end6_;
14987 typename ParamGenerator<T6>::iterator current6_;
14988 const typename ParamGenerator<T7>::iterator begin7_;
14989 const typename ParamGenerator<T7>::iterator end7_;
14990 typename ParamGenerator<T7>::iterator current7_;
14991 const typename ParamGenerator<T8>::iterator begin8_;
14992 const typename ParamGenerator<T8>::iterator end8_;
14993 typename ParamGenerator<T8>::iterator current8_;
14994 ParamType current_value_;
14995 }; // class CartesianProductGenerator8::Iterator
14996
14997 // No implementation - assignment is unsupported.
14998 void operator=(const CartesianProductGenerator8& other);
14999
15000 const ParamGenerator<T1> g1_;
15001 const ParamGenerator<T2> g2_;
15002 const ParamGenerator<T3> g3_;
15003 const ParamGenerator<T4> g4_;
15004 const ParamGenerator<T5> g5_;
15005 const ParamGenerator<T6> g6_;
15006 const ParamGenerator<T7> g7_;
15007 const ParamGenerator<T8> g8_;
15008}; // class CartesianProductGenerator8
15009
15010
15011template <typename T1, typename T2, typename T3, typename T4, typename T5,
15012 typename T6, typename T7, typename T8, typename T9>
15013class CartesianProductGenerator9
15014 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15015 T7, T8, T9> > {
15016 public:
15017 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
15018
15019 CartesianProductGenerator9(const ParamGenerator<T1>& g1,
15020 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15021 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15022 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
15023 const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
15024 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15025 g9_(g9) {}
15026 virtual ~CartesianProductGenerator9() {}
15027
15028 virtual ParamIteratorInterface<ParamType>* Begin() const {
15029 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15030 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15031 g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
15032 }
15033 virtual ParamIteratorInterface<ParamType>* End() const {
15034 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15035 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
15036 g8_.end(), g9_, g9_.end());
15037 }
15038
15039 private:
15040 class Iterator : public ParamIteratorInterface<ParamType> {
15041 public:
15042 Iterator(const ParamGeneratorInterface<ParamType>* base,
15043 const ParamGenerator<T1>& g1,
15044 const typename ParamGenerator<T1>::iterator& current1,
15045 const ParamGenerator<T2>& g2,
15046 const typename ParamGenerator<T2>::iterator& current2,
15047 const ParamGenerator<T3>& g3,
15048 const typename ParamGenerator<T3>::iterator& current3,
15049 const ParamGenerator<T4>& g4,
15050 const typename ParamGenerator<T4>::iterator& current4,
15051 const ParamGenerator<T5>& g5,
15052 const typename ParamGenerator<T5>::iterator& current5,
15053 const ParamGenerator<T6>& g6,
15054 const typename ParamGenerator<T6>::iterator& current6,
15055 const ParamGenerator<T7>& g7,
15056 const typename ParamGenerator<T7>::iterator& current7,
15057 const ParamGenerator<T8>& g8,
15058 const typename ParamGenerator<T8>::iterator& current8,
15059 const ParamGenerator<T9>& g9,
15060 const typename ParamGenerator<T9>::iterator& current9)
15061 : base_(base),
15062 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15063 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15064 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15065 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15066 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15067 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15068 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15069 begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15070 begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
15071 ComputeCurrentValue();
15072 }
15073 virtual ~Iterator() {}
15074
15075 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15076 return base_;
15077 }
15078 // Advance should not be called on beyond-of-range iterators
15079 // so no component iterators must be beyond end of range, either.
15080 virtual void Advance() {
15081 assert(!AtEnd());
15082 ++current9_;
15083 if (current9_ == end9_) {
15084 current9_ = begin9_;
15085 ++current8_;
15086 }
15087 if (current8_ == end8_) {
15088 current8_ = begin8_;
15089 ++current7_;
15090 }
15091 if (current7_ == end7_) {
15092 current7_ = begin7_;
15093 ++current6_;
15094 }
15095 if (current6_ == end6_) {
15096 current6_ = begin6_;
15097 ++current5_;
15098 }
15099 if (current5_ == end5_) {
15100 current5_ = begin5_;
15101 ++current4_;
15102 }
15103 if (current4_ == end4_) {
15104 current4_ = begin4_;
15105 ++current3_;
15106 }
15107 if (current3_ == end3_) {
15108 current3_ = begin3_;
15109 ++current2_;
15110 }
15111 if (current2_ == end2_) {
15112 current2_ = begin2_;
15113 ++current1_;
15114 }
15115 ComputeCurrentValue();
15116 }
15117 virtual ParamIteratorInterface<ParamType>* Clone() const {
15118 return new Iterator(*this);
15119 }
15120 virtual const ParamType* Current() const { return &current_value_; }
15121 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15122 // Having the same base generator guarantees that the other
15123 // iterator is of the same type and we can downcast.
15124 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15125 << "The program attempted to compare iterators "
15126 << "from different generators." << std::endl;
15127 const Iterator* typed_other =
15128 CheckedDowncastToActualType<const Iterator>(&other);
15129 // We must report iterators equal if they both point beyond their
15130 // respective ranges. That can happen in a variety of fashions,
15131 // so we have to consult AtEnd().
15132 return (AtEnd() && typed_other->AtEnd()) ||
15133 (
15134 current1_ == typed_other->current1_ &&
15135 current2_ == typed_other->current2_ &&
15136 current3_ == typed_other->current3_ &&
15137 current4_ == typed_other->current4_ &&
15138 current5_ == typed_other->current5_ &&
15139 current6_ == typed_other->current6_ &&
15140 current7_ == typed_other->current7_ &&
15141 current8_ == typed_other->current8_ &&
15142 current9_ == typed_other->current9_);
15143 }
15144
15145 private:
15146 Iterator(const Iterator& other)
15147 : base_(other.base_),
15148 begin1_(other.begin1_),
15149 end1_(other.end1_),
15150 current1_(other.current1_),
15151 begin2_(other.begin2_),
15152 end2_(other.end2_),
15153 current2_(other.current2_),
15154 begin3_(other.begin3_),
15155 end3_(other.end3_),
15156 current3_(other.current3_),
15157 begin4_(other.begin4_),
15158 end4_(other.end4_),
15159 current4_(other.current4_),
15160 begin5_(other.begin5_),
15161 end5_(other.end5_),
15162 current5_(other.current5_),
15163 begin6_(other.begin6_),
15164 end6_(other.end6_),
15165 current6_(other.current6_),
15166 begin7_(other.begin7_),
15167 end7_(other.end7_),
15168 current7_(other.current7_),
15169 begin8_(other.begin8_),
15170 end8_(other.end8_),
15171 current8_(other.current8_),
15172 begin9_(other.begin9_),
15173 end9_(other.end9_),
15174 current9_(other.current9_) {
15175 ComputeCurrentValue();
15176 }
15177
15178 void ComputeCurrentValue() {
15179 if (!AtEnd())
15180 current_value_ = ParamType(*current1_, *current2_, *current3_,
15181 *current4_, *current5_, *current6_, *current7_, *current8_,
15182 *current9_);
15183 }
15184 bool AtEnd() const {
15185 // We must report iterator past the end of the range when either of the
15186 // component iterators has reached the end of its range.
15187 return
15188 current1_ == end1_ ||
15189 current2_ == end2_ ||
15190 current3_ == end3_ ||
15191 current4_ == end4_ ||
15192 current5_ == end5_ ||
15193 current6_ == end6_ ||
15194 current7_ == end7_ ||
15195 current8_ == end8_ ||
15196 current9_ == end9_;
15197 }
15198
15199 // No implementation - assignment is unsupported.
15200 void operator=(const Iterator& other);
15201
15202 const ParamGeneratorInterface<ParamType>* const base_;
15203 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15204 // current[i]_ is the actual traversing iterator.
15205 const typename ParamGenerator<T1>::iterator begin1_;
15206 const typename ParamGenerator<T1>::iterator end1_;
15207 typename ParamGenerator<T1>::iterator current1_;
15208 const typename ParamGenerator<T2>::iterator begin2_;
15209 const typename ParamGenerator<T2>::iterator end2_;
15210 typename ParamGenerator<T2>::iterator current2_;
15211 const typename ParamGenerator<T3>::iterator begin3_;
15212 const typename ParamGenerator<T3>::iterator end3_;
15213 typename ParamGenerator<T3>::iterator current3_;
15214 const typename ParamGenerator<T4>::iterator begin4_;
15215 const typename ParamGenerator<T4>::iterator end4_;
15216 typename ParamGenerator<T4>::iterator current4_;
15217 const typename ParamGenerator<T5>::iterator begin5_;
15218 const typename ParamGenerator<T5>::iterator end5_;
15219 typename ParamGenerator<T5>::iterator current5_;
15220 const typename ParamGenerator<T6>::iterator begin6_;
15221 const typename ParamGenerator<T6>::iterator end6_;
15222 typename ParamGenerator<T6>::iterator current6_;
15223 const typename ParamGenerator<T7>::iterator begin7_;
15224 const typename ParamGenerator<T7>::iterator end7_;
15225 typename ParamGenerator<T7>::iterator current7_;
15226 const typename ParamGenerator<T8>::iterator begin8_;
15227 const typename ParamGenerator<T8>::iterator end8_;
15228 typename ParamGenerator<T8>::iterator current8_;
15229 const typename ParamGenerator<T9>::iterator begin9_;
15230 const typename ParamGenerator<T9>::iterator end9_;
15231 typename ParamGenerator<T9>::iterator current9_;
15232 ParamType current_value_;
15233 }; // class CartesianProductGenerator9::Iterator
15234
15235 // No implementation - assignment is unsupported.
15236 void operator=(const CartesianProductGenerator9& other);
15237
15238 const ParamGenerator<T1> g1_;
15239 const ParamGenerator<T2> g2_;
15240 const ParamGenerator<T3> g3_;
15241 const ParamGenerator<T4> g4_;
15242 const ParamGenerator<T5> g5_;
15243 const ParamGenerator<T6> g6_;
15244 const ParamGenerator<T7> g7_;
15245 const ParamGenerator<T8> g8_;
15246 const ParamGenerator<T9> g9_;
15247}; // class CartesianProductGenerator9
15248
15249
15250template <typename T1, typename T2, typename T3, typename T4, typename T5,
15251 typename T6, typename T7, typename T8, typename T9, typename T10>
15252class CartesianProductGenerator10
15253 : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15254 T7, T8, T9, T10> > {
15255 public:
15256 typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
15257
15258 CartesianProductGenerator10(const ParamGenerator<T1>& g1,
15259 const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15260 const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15261 const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
15262 const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
15263 const ParamGenerator<T10>& g10)
15264 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15265 g9_(g9), g10_(g10) {}
15266 virtual ~CartesianProductGenerator10() {}
15267
15268 virtual ParamIteratorInterface<ParamType>* Begin() const {
15269 return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15270 g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15271 g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
15272 }
15273 virtual ParamIteratorInterface<ParamType>* End() const {
15274 return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15275 g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
15276 g8_.end(), g9_, g9_.end(), g10_, g10_.end());
15277 }
15278
15279 private:
15280 class Iterator : public ParamIteratorInterface<ParamType> {
15281 public:
15282 Iterator(const ParamGeneratorInterface<ParamType>* base,
15283 const ParamGenerator<T1>& g1,
15284 const typename ParamGenerator<T1>::iterator& current1,
15285 const ParamGenerator<T2>& g2,
15286 const typename ParamGenerator<T2>::iterator& current2,
15287 const ParamGenerator<T3>& g3,
15288 const typename ParamGenerator<T3>::iterator& current3,
15289 const ParamGenerator<T4>& g4,
15290 const typename ParamGenerator<T4>::iterator& current4,
15291 const ParamGenerator<T5>& g5,
15292 const typename ParamGenerator<T5>::iterator& current5,
15293 const ParamGenerator<T6>& g6,
15294 const typename ParamGenerator<T6>::iterator& current6,
15295 const ParamGenerator<T7>& g7,
15296 const typename ParamGenerator<T7>::iterator& current7,
15297 const ParamGenerator<T8>& g8,
15298 const typename ParamGenerator<T8>::iterator& current8,
15299 const ParamGenerator<T9>& g9,
15300 const typename ParamGenerator<T9>::iterator& current9,
15301 const ParamGenerator<T10>& g10,
15302 const typename ParamGenerator<T10>::iterator& current10)
15303 : base_(base),
15304 begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15305 begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15306 begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15307 begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15308 begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15309 begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15310 begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15311 begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15312 begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
15313 begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
15314 ComputeCurrentValue();
15315 }
15316 virtual ~Iterator() {}
15317
15318 virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15319 return base_;
15320 }
15321 // Advance should not be called on beyond-of-range iterators
15322 // so no component iterators must be beyond end of range, either.
15323 virtual void Advance() {
15324 assert(!AtEnd());
15325 ++current10_;
15326 if (current10_ == end10_) {
15327 current10_ = begin10_;
15328 ++current9_;
15329 }
15330 if (current9_ == end9_) {
15331 current9_ = begin9_;
15332 ++current8_;
15333 }
15334 if (current8_ == end8_) {
15335 current8_ = begin8_;
15336 ++current7_;
15337 }
15338 if (current7_ == end7_) {
15339 current7_ = begin7_;
15340 ++current6_;
15341 }
15342 if (current6_ == end6_) {
15343 current6_ = begin6_;
15344 ++current5_;
15345 }
15346 if (current5_ == end5_) {
15347 current5_ = begin5_;
15348 ++current4_;
15349 }
15350 if (current4_ == end4_) {
15351 current4_ = begin4_;
15352 ++current3_;
15353 }
15354 if (current3_ == end3_) {
15355 current3_ = begin3_;
15356 ++current2_;
15357 }
15358 if (current2_ == end2_) {
15359 current2_ = begin2_;
15360 ++current1_;
15361 }
15362 ComputeCurrentValue();
15363 }
15364 virtual ParamIteratorInterface<ParamType>* Clone() const {
15365 return new Iterator(*this);
15366 }
15367 virtual const ParamType* Current() const { return &current_value_; }
15368 virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15369 // Having the same base generator guarantees that the other
15370 // iterator is of the same type and we can downcast.
15371 GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15372 << "The program attempted to compare iterators "
15373 << "from different generators." << std::endl;
15374 const Iterator* typed_other =
15375 CheckedDowncastToActualType<const Iterator>(&other);
15376 // We must report iterators equal if they both point beyond their
15377 // respective ranges. That can happen in a variety of fashions,
15378 // so we have to consult AtEnd().
15379 return (AtEnd() && typed_other->AtEnd()) ||
15380 (
15381 current1_ == typed_other->current1_ &&
15382 current2_ == typed_other->current2_ &&
15383 current3_ == typed_other->current3_ &&
15384 current4_ == typed_other->current4_ &&
15385 current5_ == typed_other->current5_ &&
15386 current6_ == typed_other->current6_ &&
15387 current7_ == typed_other->current7_ &&
15388 current8_ == typed_other->current8_ &&
15389 current9_ == typed_other->current9_ &&
15390 current10_ == typed_other->current10_);
15391 }
15392
15393 private:
15394 Iterator(const Iterator& other)
15395 : base_(other.base_),
15396 begin1_(other.begin1_),
15397 end1_(other.end1_),
15398 current1_(other.current1_),
15399 begin2_(other.begin2_),
15400 end2_(other.end2_),
15401 current2_(other.current2_),
15402 begin3_(other.begin3_),
15403 end3_(other.end3_),
15404 current3_(other.current3_),
15405 begin4_(other.begin4_),
15406 end4_(other.end4_),
15407 current4_(other.current4_),
15408 begin5_(other.begin5_),
15409 end5_(other.end5_),
15410 current5_(other.current5_),
15411 begin6_(other.begin6_),
15412 end6_(other.end6_),
15413 current6_(other.current6_),
15414 begin7_(other.begin7_),
15415 end7_(other.end7_),
15416 current7_(other.current7_),
15417 begin8_(other.begin8_),
15418 end8_(other.end8_),
15419 current8_(other.current8_),
15420 begin9_(other.begin9_),
15421 end9_(other.end9_),
15422 current9_(other.current9_),
15423 begin10_(other.begin10_),
15424 end10_(other.end10_),
15425 current10_(other.current10_) {
15426 ComputeCurrentValue();
15427 }
15428
15429 void ComputeCurrentValue() {
15430 if (!AtEnd())
15431 current_value_ = ParamType(*current1_, *current2_, *current3_,
15432 *current4_, *current5_, *current6_, *current7_, *current8_,
15433 *current9_, *current10_);
15434 }
15435 bool AtEnd() const {
15436 // We must report iterator past the end of the range when either of the
15437 // component iterators has reached the end of its range.
15438 return
15439 current1_ == end1_ ||
15440 current2_ == end2_ ||
15441 current3_ == end3_ ||
15442 current4_ == end4_ ||
15443 current5_ == end5_ ||
15444 current6_ == end6_ ||
15445 current7_ == end7_ ||
15446 current8_ == end8_ ||
15447 current9_ == end9_ ||
15448 current10_ == end10_;
15449 }
15450
15451 // No implementation - assignment is unsupported.
15452 void operator=(const Iterator& other);
15453
15454 const ParamGeneratorInterface<ParamType>* const base_;
15455 // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15456 // current[i]_ is the actual traversing iterator.
15457 const typename ParamGenerator<T1>::iterator begin1_;
15458 const typename ParamGenerator<T1>::iterator end1_;
15459 typename ParamGenerator<T1>::iterator current1_;
15460 const typename ParamGenerator<T2>::iterator begin2_;
15461 const typename ParamGenerator<T2>::iterator end2_;
15462 typename ParamGenerator<T2>::iterator current2_;
15463 const typename ParamGenerator<T3>::iterator begin3_;
15464 const typename ParamGenerator<T3>::iterator end3_;
15465 typename ParamGenerator<T3>::iterator current3_;
15466 const typename ParamGenerator<T4>::iterator begin4_;
15467 const typename ParamGenerator<T4>::iterator end4_;
15468 typename ParamGenerator<T4>::iterator current4_;
15469 const typename ParamGenerator<T5>::iterator begin5_;
15470 const typename ParamGenerator<T5>::iterator end5_;
15471 typename ParamGenerator<T5>::iterator current5_;
15472 const typename ParamGenerator<T6>::iterator begin6_;
15473 const typename ParamGenerator<T6>::iterator end6_;
15474 typename ParamGenerator<T6>::iterator current6_;
15475 const typename ParamGenerator<T7>::iterator begin7_;
15476 const typename ParamGenerator<T7>::iterator end7_;
15477 typename ParamGenerator<T7>::iterator current7_;
15478 const typename ParamGenerator<T8>::iterator begin8_;
15479 const typename ParamGenerator<T8>::iterator end8_;
15480 typename ParamGenerator<T8>::iterator current8_;
15481 const typename ParamGenerator<T9>::iterator begin9_;
15482 const typename ParamGenerator<T9>::iterator end9_;
15483 typename ParamGenerator<T9>::iterator current9_;
15484 const typename ParamGenerator<T10>::iterator begin10_;
15485 const typename ParamGenerator<T10>::iterator end10_;
15486 typename ParamGenerator<T10>::iterator current10_;
15487 ParamType current_value_;
15488 }; // class CartesianProductGenerator10::Iterator
15489
15490 // No implementation - assignment is unsupported.
15491 void operator=(const CartesianProductGenerator10& other);
15492
15493 const ParamGenerator<T1> g1_;
15494 const ParamGenerator<T2> g2_;
15495 const ParamGenerator<T3> g3_;
15496 const ParamGenerator<T4> g4_;
15497 const ParamGenerator<T5> g5_;
15498 const ParamGenerator<T6> g6_;
15499 const ParamGenerator<T7> g7_;
15500 const ParamGenerator<T8> g8_;
15501 const ParamGenerator<T9> g9_;
15502 const ParamGenerator<T10> g10_;
15503}; // class CartesianProductGenerator10
15504
15505
15506// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15507//
15508// Helper classes providing Combine() with polymorphic features. They allow
15509// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
15510// convertible to U.
15511//
15512template <class Generator1, class Generator2>
15513class CartesianProductHolder2 {
15514 public:
15515CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
15516 : g1_(g1), g2_(g2) {}
15517 template <typename T1, typename T2>
15518 operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
15519 return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
15520 new CartesianProductGenerator2<T1, T2>(
15521 static_cast<ParamGenerator<T1> >(g1_),
15522 static_cast<ParamGenerator<T2> >(g2_)));
15523 }
15524
15525 private:
15526 // No implementation - assignment is unsupported.
15527 void operator=(const CartesianProductHolder2& other);
15528
15529 const Generator1 g1_;
15530 const Generator2 g2_;
15531}; // class CartesianProductHolder2
15532
15533template <class Generator1, class Generator2, class Generator3>
15534class CartesianProductHolder3 {
15535 public:
15536CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
15537 const Generator3& g3)
15538 : g1_(g1), g2_(g2), g3_(g3) {}
15539 template <typename T1, typename T2, typename T3>
15540 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
15541 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
15542 new CartesianProductGenerator3<T1, T2, T3>(
15543 static_cast<ParamGenerator<T1> >(g1_),
15544 static_cast<ParamGenerator<T2> >(g2_),
15545 static_cast<ParamGenerator<T3> >(g3_)));
15546 }
15547
15548 private:
15549 // No implementation - assignment is unsupported.
15550 void operator=(const CartesianProductHolder3& other);
15551
15552 const Generator1 g1_;
15553 const Generator2 g2_;
15554 const Generator3 g3_;
15555}; // class CartesianProductHolder3
15556
15557template <class Generator1, class Generator2, class Generator3,
15558 class Generator4>
15559class CartesianProductHolder4 {
15560 public:
15561CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
15562 const Generator3& g3, const Generator4& g4)
15563 : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
15564 template <typename T1, typename T2, typename T3, typename T4>
15565 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
15566 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
15567 new CartesianProductGenerator4<T1, T2, T3, T4>(
15568 static_cast<ParamGenerator<T1> >(g1_),
15569 static_cast<ParamGenerator<T2> >(g2_),
15570 static_cast<ParamGenerator<T3> >(g3_),
15571 static_cast<ParamGenerator<T4> >(g4_)));
15572 }
15573
15574 private:
15575 // No implementation - assignment is unsupported.
15576 void operator=(const CartesianProductHolder4& other);
15577
15578 const Generator1 g1_;
15579 const Generator2 g2_;
15580 const Generator3 g3_;
15581 const Generator4 g4_;
15582}; // class CartesianProductHolder4
15583
15584template <class Generator1, class Generator2, class Generator3,
15585 class Generator4, class Generator5>
15586class CartesianProductHolder5 {
15587 public:
15588CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
15589 const Generator3& g3, const Generator4& g4, const Generator5& g5)
15590 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
15591 template <typename T1, typename T2, typename T3, typename T4, typename T5>
15592 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
15593 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
15594 new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
15595 static_cast<ParamGenerator<T1> >(g1_),
15596 static_cast<ParamGenerator<T2> >(g2_),
15597 static_cast<ParamGenerator<T3> >(g3_),
15598 static_cast<ParamGenerator<T4> >(g4_),
15599 static_cast<ParamGenerator<T5> >(g5_)));
15600 }
15601
15602 private:
15603 // No implementation - assignment is unsupported.
15604 void operator=(const CartesianProductHolder5& other);
15605
15606 const Generator1 g1_;
15607 const Generator2 g2_;
15608 const Generator3 g3_;
15609 const Generator4 g4_;
15610 const Generator5 g5_;
15611}; // class CartesianProductHolder5
15612
15613template <class Generator1, class Generator2, class Generator3,
15614 class Generator4, class Generator5, class Generator6>
15615class CartesianProductHolder6 {
15616 public:
15617CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
15618 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15619 const Generator6& g6)
15620 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
15621 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15622 typename T6>
15623 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
15624 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
15625 new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
15626 static_cast<ParamGenerator<T1> >(g1_),
15627 static_cast<ParamGenerator<T2> >(g2_),
15628 static_cast<ParamGenerator<T3> >(g3_),
15629 static_cast<ParamGenerator<T4> >(g4_),
15630 static_cast<ParamGenerator<T5> >(g5_),
15631 static_cast<ParamGenerator<T6> >(g6_)));
15632 }
15633
15634 private:
15635 // No implementation - assignment is unsupported.
15636 void operator=(const CartesianProductHolder6& other);
15637
15638 const Generator1 g1_;
15639 const Generator2 g2_;
15640 const Generator3 g3_;
15641 const Generator4 g4_;
15642 const Generator5 g5_;
15643 const Generator6 g6_;
15644}; // class CartesianProductHolder6
15645
15646template <class Generator1, class Generator2, class Generator3,
15647 class Generator4, class Generator5, class Generator6, class Generator7>
15648class CartesianProductHolder7 {
15649 public:
15650CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
15651 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15652 const Generator6& g6, const Generator7& g7)
15653 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
15654 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15655 typename T6, typename T7>
15656 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15657 T7> >() const {
15658 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
15659 new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
15660 static_cast<ParamGenerator<T1> >(g1_),
15661 static_cast<ParamGenerator<T2> >(g2_),
15662 static_cast<ParamGenerator<T3> >(g3_),
15663 static_cast<ParamGenerator<T4> >(g4_),
15664 static_cast<ParamGenerator<T5> >(g5_),
15665 static_cast<ParamGenerator<T6> >(g6_),
15666 static_cast<ParamGenerator<T7> >(g7_)));
15667 }
15668
15669 private:
15670 // No implementation - assignment is unsupported.
15671 void operator=(const CartesianProductHolder7& other);
15672
15673 const Generator1 g1_;
15674 const Generator2 g2_;
15675 const Generator3 g3_;
15676 const Generator4 g4_;
15677 const Generator5 g5_;
15678 const Generator6 g6_;
15679 const Generator7 g7_;
15680}; // class CartesianProductHolder7
15681
15682template <class Generator1, class Generator2, class Generator3,
15683 class Generator4, class Generator5, class Generator6, class Generator7,
15684 class Generator8>
15685class CartesianProductHolder8 {
15686 public:
15687CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
15688 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15689 const Generator6& g6, const Generator7& g7, const Generator8& g8)
15690 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
15691 g8_(g8) {}
15692 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15693 typename T6, typename T7, typename T8>
15694 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
15695 T8> >() const {
15696 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
15697 new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
15698 static_cast<ParamGenerator<T1> >(g1_),
15699 static_cast<ParamGenerator<T2> >(g2_),
15700 static_cast<ParamGenerator<T3> >(g3_),
15701 static_cast<ParamGenerator<T4> >(g4_),
15702 static_cast<ParamGenerator<T5> >(g5_),
15703 static_cast<ParamGenerator<T6> >(g6_),
15704 static_cast<ParamGenerator<T7> >(g7_),
15705 static_cast<ParamGenerator<T8> >(g8_)));
15706 }
15707
15708 private:
15709 // No implementation - assignment is unsupported.
15710 void operator=(const CartesianProductHolder8& other);
15711
15712 const Generator1 g1_;
15713 const Generator2 g2_;
15714 const Generator3 g3_;
15715 const Generator4 g4_;
15716 const Generator5 g5_;
15717 const Generator6 g6_;
15718 const Generator7 g7_;
15719 const Generator8 g8_;
15720}; // class CartesianProductHolder8
15721
15722template <class Generator1, class Generator2, class Generator3,
15723 class Generator4, class Generator5, class Generator6, class Generator7,
15724 class Generator8, class Generator9>
15725class CartesianProductHolder9 {
15726 public:
15727CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
15728 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15729 const Generator6& g6, const Generator7& g7, const Generator8& g8,
15730 const Generator9& g9)
15731 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15732 g9_(g9) {}
15733 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15734 typename T6, typename T7, typename T8, typename T9>
15735 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15736 T9> >() const {
15737 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15738 T9> >(
15739 new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
15740 static_cast<ParamGenerator<T1> >(g1_),
15741 static_cast<ParamGenerator<T2> >(g2_),
15742 static_cast<ParamGenerator<T3> >(g3_),
15743 static_cast<ParamGenerator<T4> >(g4_),
15744 static_cast<ParamGenerator<T5> >(g5_),
15745 static_cast<ParamGenerator<T6> >(g6_),
15746 static_cast<ParamGenerator<T7> >(g7_),
15747 static_cast<ParamGenerator<T8> >(g8_),
15748 static_cast<ParamGenerator<T9> >(g9_)));
15749 }
15750
15751 private:
15752 // No implementation - assignment is unsupported.
15753 void operator=(const CartesianProductHolder9& other);
15754
15755 const Generator1 g1_;
15756 const Generator2 g2_;
15757 const Generator3 g3_;
15758 const Generator4 g4_;
15759 const Generator5 g5_;
15760 const Generator6 g6_;
15761 const Generator7 g7_;
15762 const Generator8 g8_;
15763 const Generator9 g9_;
15764}; // class CartesianProductHolder9
15765
15766template <class Generator1, class Generator2, class Generator3,
15767 class Generator4, class Generator5, class Generator6, class Generator7,
15768 class Generator8, class Generator9, class Generator10>
15769class CartesianProductHolder10 {
15770 public:
15771CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
15772 const Generator3& g3, const Generator4& g4, const Generator5& g5,
15773 const Generator6& g6, const Generator7& g7, const Generator8& g8,
15774 const Generator9& g9, const Generator10& g10)
15775 : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15776 g9_(g9), g10_(g10) {}
15777 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15778 typename T6, typename T7, typename T8, typename T9, typename T10>
15779 operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15780 T9, T10> >() const {
15781 return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15782 T9, T10> >(
15783 new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
15784 T10>(
15785 static_cast<ParamGenerator<T1> >(g1_),
15786 static_cast<ParamGenerator<T2> >(g2_),
15787 static_cast<ParamGenerator<T3> >(g3_),
15788 static_cast<ParamGenerator<T4> >(g4_),
15789 static_cast<ParamGenerator<T5> >(g5_),
15790 static_cast<ParamGenerator<T6> >(g6_),
15791 static_cast<ParamGenerator<T7> >(g7_),
15792 static_cast<ParamGenerator<T8> >(g8_),
15793 static_cast<ParamGenerator<T9> >(g9_),
15794 static_cast<ParamGenerator<T10> >(g10_)));
15795 }
15796
15797 private:
15798 // No implementation - assignment is unsupported.
15799 void operator=(const CartesianProductHolder10& other);
15800
15801 const Generator1 g1_;
15802 const Generator2 g2_;
15803 const Generator3 g3_;
15804 const Generator4 g4_;
15805 const Generator5 g5_;
15806 const Generator6 g6_;
15807 const Generator7 g7_;
15808 const Generator8 g8_;
15809 const Generator9 g9_;
15810 const Generator10 g10_;
15811}; // class CartesianProductHolder10
15812
15813# endif // GTEST_HAS_COMBINE
15814
15815} // namespace internal
15816} // namespace testing
15817
15818#endif // GTEST_HAS_PARAM_TEST
15819
15820#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
15821
15822#if GTEST_HAS_PARAM_TEST
15823
15824namespace testing {
15825
15826// Functions producing parameter generators.
15827//
15828// Google Test uses these generators to produce parameters for value-
15829// parameterized tests. When a parameterized test case is instantiated
15830// with a particular generator, Google Test creates and runs tests
15831// for each element in the sequence produced by the generator.
15832//
15833// In the following sample, tests from test case FooTest are instantiated
15834// each three times with parameter values 3, 5, and 8:
15835//
15836// class FooTest : public TestWithParam<int> { ... };
15837//
15838// TEST_P(FooTest, TestThis) {
15839// }
15840// TEST_P(FooTest, TestThat) {
15841// }
15842// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
15843//
15844
15845// Range() returns generators providing sequences of values in a range.
15846//
15847// Synopsis:
15848// Range(start, end)
15849// - returns a generator producing a sequence of values {start, start+1,
15850// start+2, ..., }.
15851// Range(start, end, step)
15852// - returns a generator producing a sequence of values {start, start+step,
15853// start+step+step, ..., }.
15854// Notes:
15855// * The generated sequences never include end. For example, Range(1, 5)
15856// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
15857// returns a generator producing {1, 3, 5, 7}.
15858// * start and end must have the same type. That type may be any integral or
15859// floating-point type or a user defined type satisfying these conditions:
15860// * It must be assignable (have operator=() defined).
15861// * It must have operator+() (operator+(int-compatible type) for
15862// two-operand version).
15863// * It must have operator<() defined.
15864// Elements in the resulting sequences will also have that type.
15865// * Condition start < end must be satisfied in order for resulting sequences
15866// to contain any elements.
15867//
15868template <typename T, typename IncrementT>
15869internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
15870 return internal::ParamGenerator<T>(
15871 new internal::RangeGenerator<T, IncrementT>(start, end, step));
15872}
15873
15874template <typename T>
15875internal::ParamGenerator<T> Range(T start, T end) {
15876 return Range(start, end, 1);
15877}
15878
15879// ValuesIn() function allows generation of tests with parameters coming from
15880// a container.
15881//
15882// Synopsis:
15883// ValuesIn(const T (&array)[N])
15884// - returns a generator producing sequences with elements from
15885// a C-style array.
15886// ValuesIn(const Container& container)
15887// - returns a generator producing sequences with elements from
15888// an STL-style container.
15889// ValuesIn(Iterator begin, Iterator end)
15890// - returns a generator producing sequences with elements from
15891// a range [begin, end) defined by a pair of STL-style iterators. These
15892// iterators can also be plain C pointers.
15893//
15894// Please note that ValuesIn copies the values from the containers
15895// passed in and keeps them to generate tests in RUN_ALL_TESTS().
15896//
15897// Examples:
15898//
15899// This instantiates tests from test case StringTest
15900// each with C-string values of "foo", "bar", and "baz":
15901//
15902// const char* strings[] = {"foo", "bar", "baz"};
15903// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
15904//
15905// This instantiates tests from test case StlStringTest
15906// each with STL strings with values "a" and "b":
15907//
15908// ::std::vector< ::std::string> GetParameterStrings() {
15909// ::std::vector< ::std::string> v;
15910// v.push_back("a");
15911// v.push_back("b");
15912// return v;
15913// }
15914//
15915// INSTANTIATE_TEST_CASE_P(CharSequence,
15916// StlStringTest,
15917// ValuesIn(GetParameterStrings()));
15918//
15919//
15920// This will also instantiate tests from CharTest
15921// each with parameter values 'a' and 'b':
15922//
15923// ::std::list<char> GetParameterChars() {
15924// ::std::list<char> list;
15925// list.push_back('a');
15926// list.push_back('b');
15927// return list;
15928// }
15929// ::std::list<char> l = GetParameterChars();
15930// INSTANTIATE_TEST_CASE_P(CharSequence2,
15931// CharTest,
15932// ValuesIn(l.begin(), l.end()));
15933//
15934template <typename ForwardIterator>
15935internal::ParamGenerator<
15936 typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
15937ValuesIn(ForwardIterator begin, ForwardIterator end) {
15938 typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
15939 ::value_type ParamType;
15940 return internal::ParamGenerator<ParamType>(
15941 new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
15942}
15943
15944template <typename T, size_t N>
15945internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
15946 return ValuesIn(array, array + N);
15947}
15948
15949template <class Container>
15950internal::ParamGenerator<typename Container::value_type> ValuesIn(
15951 const Container& container) {
15952 return ValuesIn(container.begin(), container.end());
15953}
15954
15955// Values() allows generating tests from explicitly specified list of
15956// parameters.
15957//
15958// Synopsis:
15959// Values(T v1, T v2, ..., T vN)
15960// - returns a generator producing sequences with elements v1, v2, ..., vN.
15961//
15962// For example, this instantiates tests from test case BarTest each
15963// with values "one", "two", and "three":
15964//
15965// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
15966//
15967// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
15968// The exact type of values will depend on the type of parameter in BazTest.
15969//
15970// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
15971//
15972// Currently, Values() supports from 1 to 50 parameters.
15973//
15974template <typename T1>
15975internal::ValueArray1<T1> Values(T1 v1) {
15976 return internal::ValueArray1<T1>(v1);
15977}
15978
15979template <typename T1, typename T2>
15980internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
15981 return internal::ValueArray2<T1, T2>(v1, v2);
15982}
15983
15984template <typename T1, typename T2, typename T3>
15985internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
15986 return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
15987}
15988
15989template <typename T1, typename T2, typename T3, typename T4>
15990internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
15991 return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
15992}
15993
15994template <typename T1, typename T2, typename T3, typename T4, typename T5>
15995internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
15996 T5 v5) {
15997 return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
15998}
15999
16000template <typename T1, typename T2, typename T3, typename T4, typename T5,
16001 typename T6>
16002internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
16003 T4 v4, T5 v5, T6 v6) {
16004 return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
16005}
16006
16007template <typename T1, typename T2, typename T3, typename T4, typename T5,
16008 typename T6, typename T7>
16009internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
16010 T4 v4, T5 v5, T6 v6, T7 v7) {
16011 return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
16012 v6, v7);
16013}
16014
16015template <typename T1, typename T2, typename T3, typename T4, typename T5,
16016 typename T6, typename T7, typename T8>
16017internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
16018 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
16019 return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
16020 v5, v6, v7, v8);
16021}
16022
16023template <typename T1, typename T2, typename T3, typename T4, typename T5,
16024 typename T6, typename T7, typename T8, typename T9>
16025internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
16026 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
16027 return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
16028 v4, v5, v6, v7, v8, v9);
16029}
16030
16031template <typename T1, typename T2, typename T3, typename T4, typename T5,
16032 typename T6, typename T7, typename T8, typename T9, typename T10>
16033internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
16034 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
16035 return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
16036 v2, v3, v4, v5, v6, v7, v8, v9, v10);
16037}
16038
16039template <typename T1, typename T2, typename T3, typename T4, typename T5,
16040 typename T6, typename T7, typename T8, typename T9, typename T10,
16041 typename T11>
16042internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
16043 T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16044 T10 v10, T11 v11) {
16045 return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
16046 T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
16047}
16048
16049template <typename T1, typename T2, typename T3, typename T4, typename T5,
16050 typename T6, typename T7, typename T8, typename T9, typename T10,
16051 typename T11, typename T12>
16052internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16053 T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16054 T10 v10, T11 v11, T12 v12) {
16055 return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16056 T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
16057}
16058
16059template <typename T1, typename T2, typename T3, typename T4, typename T5,
16060 typename T6, typename T7, typename T8, typename T9, typename T10,
16061 typename T11, typename T12, typename T13>
16062internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
16063 T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16064 T10 v10, T11 v11, T12 v12, T13 v13) {
16065 return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16066 T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
16067}
16068
16069template <typename T1, typename T2, typename T3, typename T4, typename T5,
16070 typename T6, typename T7, typename T8, typename T9, typename T10,
16071 typename T11, typename T12, typename T13, typename T14>
16072internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16073 T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16074 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
16075 return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16076 T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16077 v14);
16078}
16079
16080template <typename T1, typename T2, typename T3, typename T4, typename T5,
16081 typename T6, typename T7, typename T8, typename T9, typename T10,
16082 typename T11, typename T12, typename T13, typename T14, typename T15>
16083internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16084 T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16085 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
16086 return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16087 T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16088 v13, v14, v15);
16089}
16090
16091template <typename T1, typename T2, typename T3, typename T4, typename T5,
16092 typename T6, typename T7, typename T8, typename T9, typename T10,
16093 typename T11, typename T12, typename T13, typename T14, typename T15,
16094 typename T16>
16095internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16096 T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16097 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16098 T16 v16) {
16099 return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16100 T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16101 v12, v13, v14, v15, v16);
16102}
16103
16104template <typename T1, typename T2, typename T3, typename T4, typename T5,
16105 typename T6, typename T7, typename T8, typename T9, typename T10,
16106 typename T11, typename T12, typename T13, typename T14, typename T15,
16107 typename T16, typename T17>
16108internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16109 T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16110 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16111 T16 v16, T17 v17) {
16112 return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16113 T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16114 v11, v12, v13, v14, v15, v16, v17);
16115}
16116
16117template <typename T1, typename T2, typename T3, typename T4, typename T5,
16118 typename T6, typename T7, typename T8, typename T9, typename T10,
16119 typename T11, typename T12, typename T13, typename T14, typename T15,
16120 typename T16, typename T17, typename T18>
16121internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16122 T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16123 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16124 T16 v16, T17 v17, T18 v18) {
16125 return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16126 T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16127 v10, v11, v12, v13, v14, v15, v16, v17, v18);
16128}
16129
16130template <typename T1, typename T2, typename T3, typename T4, typename T5,
16131 typename T6, typename T7, typename T8, typename T9, typename T10,
16132 typename T11, typename T12, typename T13, typename T14, typename T15,
16133 typename T16, typename T17, typename T18, typename T19>
16134internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16135 T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16136 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16137 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
16138 return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16139 T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
16140 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
16141}
16142
16143template <typename T1, typename T2, typename T3, typename T4, typename T5,
16144 typename T6, typename T7, typename T8, typename T9, typename T10,
16145 typename T11, typename T12, typename T13, typename T14, typename T15,
16146 typename T16, typename T17, typename T18, typename T19, typename T20>
16147internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16148 T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16149 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16150 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
16151 return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16152 T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
16153 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
16154}
16155
16156template <typename T1, typename T2, typename T3, typename T4, typename T5,
16157 typename T6, typename T7, typename T8, typename T9, typename T10,
16158 typename T11, typename T12, typename T13, typename T14, typename T15,
16159 typename T16, typename T17, typename T18, typename T19, typename T20,
16160 typename T21>
16161internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16162 T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16163 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16164 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
16165 return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16166 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
16167 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
16168}
16169
16170template <typename T1, typename T2, typename T3, typename T4, typename T5,
16171 typename T6, typename T7, typename T8, typename T9, typename T10,
16172 typename T11, typename T12, typename T13, typename T14, typename T15,
16173 typename T16, typename T17, typename T18, typename T19, typename T20,
16174 typename T21, typename T22>
16175internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16176 T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
16177 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16178 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16179 T21 v21, T22 v22) {
16180 return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16181 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
16182 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16183 v20, v21, v22);
16184}
16185
16186template <typename T1, typename T2, typename T3, typename T4, typename T5,
16187 typename T6, typename T7, typename T8, typename T9, typename T10,
16188 typename T11, typename T12, typename T13, typename T14, typename T15,
16189 typename T16, typename T17, typename T18, typename T19, typename T20,
16190 typename T21, typename T22, typename T23>
16191internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16192 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
16193 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16194 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16195 T21 v21, T22 v22, T23 v23) {
16196 return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16197 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
16198 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16199 v20, v21, v22, v23);
16200}
16201
16202template <typename T1, typename T2, typename T3, typename T4, typename T5,
16203 typename T6, typename T7, typename T8, typename T9, typename T10,
16204 typename T11, typename T12, typename T13, typename T14, typename T15,
16205 typename T16, typename T17, typename T18, typename T19, typename T20,
16206 typename T21, typename T22, typename T23, typename T24>
16207internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16208 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
16209 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16210 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16211 T21 v21, T22 v22, T23 v23, T24 v24) {
16212 return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16213 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
16214 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16215 v19, v20, v21, v22, v23, v24);
16216}
16217
16218template <typename T1, typename T2, typename T3, typename T4, typename T5,
16219 typename T6, typename T7, typename T8, typename T9, typename T10,
16220 typename T11, typename T12, typename T13, typename T14, typename T15,
16221 typename T16, typename T17, typename T18, typename T19, typename T20,
16222 typename T21, typename T22, typename T23, typename T24, typename T25>
16223internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16224 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
16225 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16226 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16227 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
16228 return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16229 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
16230 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16231 v18, v19, v20, v21, v22, v23, v24, v25);
16232}
16233
16234template <typename T1, typename T2, typename T3, typename T4, typename T5,
16235 typename T6, typename T7, typename T8, typename T9, typename T10,
16236 typename T11, typename T12, typename T13, typename T14, typename T15,
16237 typename T16, typename T17, typename T18, typename T19, typename T20,
16238 typename T21, typename T22, typename T23, typename T24, typename T25,
16239 typename T26>
16240internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16241 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16242 T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16243 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16244 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16245 T26 v26) {
16246 return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16247 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16248 T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16249 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
16250}
16251
16252template <typename T1, typename T2, typename T3, typename T4, typename T5,
16253 typename T6, typename T7, typename T8, typename T9, typename T10,
16254 typename T11, typename T12, typename T13, typename T14, typename T15,
16255 typename T16, typename T17, typename T18, typename T19, typename T20,
16256 typename T21, typename T22, typename T23, typename T24, typename T25,
16257 typename T26, typename T27>
16258internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16259 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
16260 T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16261 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16262 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16263 T26 v26, T27 v27) {
16264 return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16265 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16266 T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16267 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
16268}
16269
16270template <typename T1, typename T2, typename T3, typename T4, typename T5,
16271 typename T6, typename T7, typename T8, typename T9, typename T10,
16272 typename T11, typename T12, typename T13, typename T14, typename T15,
16273 typename T16, typename T17, typename T18, typename T19, typename T20,
16274 typename T21, typename T22, typename T23, typename T24, typename T25,
16275 typename T26, typename T27, typename T28>
16276internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16277 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
16278 T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16279 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16280 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16281 T26 v26, T27 v27, T28 v28) {
16282 return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16283 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16284 T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16285 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16286 v28);
16287}
16288
16289template <typename T1, typename T2, typename T3, typename T4, typename T5,
16290 typename T6, typename T7, typename T8, typename T9, typename T10,
16291 typename T11, typename T12, typename T13, typename T14, typename T15,
16292 typename T16, typename T17, typename T18, typename T19, typename T20,
16293 typename T21, typename T22, typename T23, typename T24, typename T25,
16294 typename T26, typename T27, typename T28, typename T29>
16295internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16296 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16297 T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16298 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16299 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16300 T26 v26, T27 v27, T28 v28, T29 v29) {
16301 return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16302 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16303 T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16304 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16305 v27, v28, v29);
16306}
16307
16308template <typename T1, typename T2, typename T3, typename T4, typename T5,
16309 typename T6, typename T7, typename T8, typename T9, typename T10,
16310 typename T11, typename T12, typename T13, typename T14, typename T15,
16311 typename T16, typename T17, typename T18, typename T19, typename T20,
16312 typename T21, typename T22, typename T23, typename T24, typename T25,
16313 typename T26, typename T27, typename T28, typename T29, typename T30>
16314internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16315 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16316 T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16317 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16318 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16319 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
16320 return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16321 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16322 T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16323 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16324 v26, v27, v28, v29, v30);
16325}
16326
16327template <typename T1, typename T2, typename T3, typename T4, typename T5,
16328 typename T6, typename T7, typename T8, typename T9, typename T10,
16329 typename T11, typename T12, typename T13, typename T14, typename T15,
16330 typename T16, typename T17, typename T18, typename T19, typename T20,
16331 typename T21, typename T22, typename T23, typename T24, typename T25,
16332 typename T26, typename T27, typename T28, typename T29, typename T30,
16333 typename T31>
16334internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16335 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16336 T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16337 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16338 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16339 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
16340 return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16341 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16342 T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16343 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16344 v25, v26, v27, v28, v29, v30, v31);
16345}
16346
16347template <typename T1, typename T2, typename T3, typename T4, typename T5,
16348 typename T6, typename T7, typename T8, typename T9, typename T10,
16349 typename T11, typename T12, typename T13, typename T14, typename T15,
16350 typename T16, typename T17, typename T18, typename T19, typename T20,
16351 typename T21, typename T22, typename T23, typename T24, typename T25,
16352 typename T26, typename T27, typename T28, typename T29, typename T30,
16353 typename T31, typename T32>
16354internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16355 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16356 T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16357 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16358 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16359 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16360 T32 v32) {
16361 return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16362 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16363 T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16364 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16365 v24, v25, v26, v27, v28, v29, v30, v31, v32);
16366}
16367
16368template <typename T1, typename T2, typename T3, typename T4, typename T5,
16369 typename T6, typename T7, typename T8, typename T9, typename T10,
16370 typename T11, typename T12, typename T13, typename T14, typename T15,
16371 typename T16, typename T17, typename T18, typename T19, typename T20,
16372 typename T21, typename T22, typename T23, typename T24, typename T25,
16373 typename T26, typename T27, typename T28, typename T29, typename T30,
16374 typename T31, typename T32, typename T33>
16375internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16376 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16377 T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16378 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16379 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16380 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16381 T32 v32, T33 v33) {
16382 return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16383 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16384 T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
16385 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16386 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
16387}
16388
16389template <typename T1, typename T2, typename T3, typename T4, typename T5,
16390 typename T6, typename T7, typename T8, typename T9, typename T10,
16391 typename T11, typename T12, typename T13, typename T14, typename T15,
16392 typename T16, typename T17, typename T18, typename T19, typename T20,
16393 typename T21, typename T22, typename T23, typename T24, typename T25,
16394 typename T26, typename T27, typename T28, typename T29, typename T30,
16395 typename T31, typename T32, typename T33, typename T34>
16396internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16397 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16398 T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16399 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16400 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16401 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16402 T31 v31, T32 v32, T33 v33, T34 v34) {
16403 return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16404 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16405 T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
16406 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16407 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
16408}
16409
16410template <typename T1, typename T2, typename T3, typename T4, typename T5,
16411 typename T6, typename T7, typename T8, typename T9, typename T10,
16412 typename T11, typename T12, typename T13, typename T14, typename T15,
16413 typename T16, typename T17, typename T18, typename T19, typename T20,
16414 typename T21, typename T22, typename T23, typename T24, typename T25,
16415 typename T26, typename T27, typename T28, typename T29, typename T30,
16416 typename T31, typename T32, typename T33, typename T34, typename T35>
16417internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16418 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16419 T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16420 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16421 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16422 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16423 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
16424 return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16425 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16426 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
16427 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16428 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
16429}
16430
16431template <typename T1, typename T2, typename T3, typename T4, typename T5,
16432 typename T6, typename T7, typename T8, typename T9, typename T10,
16433 typename T11, typename T12, typename T13, typename T14, typename T15,
16434 typename T16, typename T17, typename T18, typename T19, typename T20,
16435 typename T21, typename T22, typename T23, typename T24, typename T25,
16436 typename T26, typename T27, typename T28, typename T29, typename T30,
16437 typename T31, typename T32, typename T33, typename T34, typename T35,
16438 typename T36>
16439internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16440 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16441 T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16442 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16443 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16444 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16445 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
16446 return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16447 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16448 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
16449 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16450 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16451 v34, v35, v36);
16452}
16453
16454template <typename T1, typename T2, typename T3, typename T4, typename T5,
16455 typename T6, typename T7, typename T8, typename T9, typename T10,
16456 typename T11, typename T12, typename T13, typename T14, typename T15,
16457 typename T16, typename T17, typename T18, typename T19, typename T20,
16458 typename T21, typename T22, typename T23, typename T24, typename T25,
16459 typename T26, typename T27, typename T28, typename T29, typename T30,
16460 typename T31, typename T32, typename T33, typename T34, typename T35,
16461 typename T36, typename T37>
16462internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16463 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16464 T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
16465 T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16466 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16467 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16468 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16469 T37 v37) {
16470 return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16471 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16472 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
16473 v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16474 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16475 v34, v35, v36, v37);
16476}
16477
16478template <typename T1, typename T2, typename T3, typename T4, typename T5,
16479 typename T6, typename T7, typename T8, typename T9, typename T10,
16480 typename T11, typename T12, typename T13, typename T14, typename T15,
16481 typename T16, typename T17, typename T18, typename T19, typename T20,
16482 typename T21, typename T22, typename T23, typename T24, typename T25,
16483 typename T26, typename T27, typename T28, typename T29, typename T30,
16484 typename T31, typename T32, typename T33, typename T34, typename T35,
16485 typename T36, typename T37, typename T38>
16486internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16487 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16488 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
16489 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16490 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16491 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16492 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16493 T37 v37, T38 v38) {
16494 return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16495 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16496 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
16497 v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16498 v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
16499 v33, v34, v35, v36, v37, v38);
16500}
16501
16502template <typename T1, typename T2, typename T3, typename T4, typename T5,
16503 typename T6, typename T7, typename T8, typename T9, typename T10,
16504 typename T11, typename T12, typename T13, typename T14, typename T15,
16505 typename T16, typename T17, typename T18, typename T19, typename T20,
16506 typename T21, typename T22, typename T23, typename T24, typename T25,
16507 typename T26, typename T27, typename T28, typename T29, typename T30,
16508 typename T31, typename T32, typename T33, typename T34, typename T35,
16509 typename T36, typename T37, typename T38, typename T39>
16510internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16511 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16512 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
16513 T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16514 T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16515 T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16516 T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16517 T37 v37, T38 v38, T39 v39) {
16518 return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16519 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16520 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
16521 v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16522 v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
16523 v32, v33, v34, v35, v36, v37, v38, v39);
16524}
16525
16526template <typename T1, typename T2, typename T3, typename T4, typename T5,
16527 typename T6, typename T7, typename T8, typename T9, typename T10,
16528 typename T11, typename T12, typename T13, typename T14, typename T15,
16529 typename T16, typename T17, typename T18, typename T19, typename T20,
16530 typename T21, typename T22, typename T23, typename T24, typename T25,
16531 typename T26, typename T27, typename T28, typename T29, typename T30,
16532 typename T31, typename T32, typename T33, typename T34, typename T35,
16533 typename T36, typename T37, typename T38, typename T39, typename T40>
16534internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16535 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16536 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
16537 T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16538 T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16539 T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
16540 T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
16541 T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
16542 return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16543 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16544 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16545 T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16546 v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
16547 v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
16548}
16549
16550template <typename T1, typename T2, typename T3, typename T4, typename T5,
16551 typename T6, typename T7, typename T8, typename T9, typename T10,
16552 typename T11, typename T12, typename T13, typename T14, typename T15,
16553 typename T16, typename T17, typename T18, typename T19, typename T20,
16554 typename T21, typename T22, typename T23, typename T24, typename T25,
16555 typename T26, typename T27, typename T28, typename T29, typename T30,
16556 typename T31, typename T32, typename T33, typename T34, typename T35,
16557 typename T36, typename T37, typename T38, typename T39, typename T40,
16558 typename T41>
16559internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16560 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16561 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
16562 T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16563 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16564 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16565 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16566 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
16567 return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16568 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16569 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16570 T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16571 v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
16572 v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
16573}
16574
16575template <typename T1, typename T2, typename T3, typename T4, typename T5,
16576 typename T6, typename T7, typename T8, typename T9, typename T10,
16577 typename T11, typename T12, typename T13, typename T14, typename T15,
16578 typename T16, typename T17, typename T18, typename T19, typename T20,
16579 typename T21, typename T22, typename T23, typename T24, typename T25,
16580 typename T26, typename T27, typename T28, typename T29, typename T30,
16581 typename T31, typename T32, typename T33, typename T34, typename T35,
16582 typename T36, typename T37, typename T38, typename T39, typename T40,
16583 typename T41, typename T42>
16584internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16585 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16586 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
16587 T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16588 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16589 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16590 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16591 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16592 T42 v42) {
16593 return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16594 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16595 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16596 T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16597 v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16598 v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
16599 v42);
16600}
16601
16602template <typename T1, typename T2, typename T3, typename T4, typename T5,
16603 typename T6, typename T7, typename T8, typename T9, typename T10,
16604 typename T11, typename T12, typename T13, typename T14, typename T15,
16605 typename T16, typename T17, typename T18, typename T19, typename T20,
16606 typename T21, typename T22, typename T23, typename T24, typename T25,
16607 typename T26, typename T27, typename T28, typename T29, typename T30,
16608 typename T31, typename T32, typename T33, typename T34, typename T35,
16609 typename T36, typename T37, typename T38, typename T39, typename T40,
16610 typename T41, typename T42, typename T43>
16611internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16612 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16613 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
16614 T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16615 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16616 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16617 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16618 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16619 T42 v42, T43 v43) {
16620 return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16621 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16622 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16623 T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16624 v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16625 v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
16626 v41, v42, v43);
16627}
16628
16629template <typename T1, typename T2, typename T3, typename T4, typename T5,
16630 typename T6, typename T7, typename T8, typename T9, typename T10,
16631 typename T11, typename T12, typename T13, typename T14, typename T15,
16632 typename T16, typename T17, typename T18, typename T19, typename T20,
16633 typename T21, typename T22, typename T23, typename T24, typename T25,
16634 typename T26, typename T27, typename T28, typename T29, typename T30,
16635 typename T31, typename T32, typename T33, typename T34, typename T35,
16636 typename T36, typename T37, typename T38, typename T39, typename T40,
16637 typename T41, typename T42, typename T43, typename T44>
16638internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16639 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16640 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16641 T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16642 T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16643 T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16644 T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16645 T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16646 T42 v42, T43 v43, T44 v44) {
16647 return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16648 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16649 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16650 T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16651 v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16652 v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
16653 v40, v41, v42, v43, v44);
16654}
16655
16656template <typename T1, typename T2, typename T3, typename T4, typename T5,
16657 typename T6, typename T7, typename T8, typename T9, typename T10,
16658 typename T11, typename T12, typename T13, typename T14, typename T15,
16659 typename T16, typename T17, typename T18, typename T19, typename T20,
16660 typename T21, typename T22, typename T23, typename T24, typename T25,
16661 typename T26, typename T27, typename T28, typename T29, typename T30,
16662 typename T31, typename T32, typename T33, typename T34, typename T35,
16663 typename T36, typename T37, typename T38, typename T39, typename T40,
16664 typename T41, typename T42, typename T43, typename T44, typename T45>
16665internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16666 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16667 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16668 T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16669 T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16670 T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16671 T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
16672 T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
16673 T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
16674 return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16675 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16676 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16677 T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16678 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16679 v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
16680 v39, v40, v41, v42, v43, v44, v45);
16681}
16682
16683template <typename T1, typename T2, typename T3, typename T4, typename T5,
16684 typename T6, typename T7, typename T8, typename T9, typename T10,
16685 typename T11, typename T12, typename T13, typename T14, typename T15,
16686 typename T16, typename T17, typename T18, typename T19, typename T20,
16687 typename T21, typename T22, typename T23, typename T24, typename T25,
16688 typename T26, typename T27, typename T28, typename T29, typename T30,
16689 typename T31, typename T32, typename T33, typename T34, typename T35,
16690 typename T36, typename T37, typename T38, typename T39, typename T40,
16691 typename T41, typename T42, typename T43, typename T44, typename T45,
16692 typename T46>
16693internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16694 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16695 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16696 T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16697 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16698 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16699 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16700 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16701 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
16702 return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16703 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16704 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16705 T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16706 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16707 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16708 v38, v39, v40, v41, v42, v43, v44, v45, v46);
16709}
16710
16711template <typename T1, typename T2, typename T3, typename T4, typename T5,
16712 typename T6, typename T7, typename T8, typename T9, typename T10,
16713 typename T11, typename T12, typename T13, typename T14, typename T15,
16714 typename T16, typename T17, typename T18, typename T19, typename T20,
16715 typename T21, typename T22, typename T23, typename T24, typename T25,
16716 typename T26, typename T27, typename T28, typename T29, typename T30,
16717 typename T31, typename T32, typename T33, typename T34, typename T35,
16718 typename T36, typename T37, typename T38, typename T39, typename T40,
16719 typename T41, typename T42, typename T43, typename T44, typename T45,
16720 typename T46, typename T47>
16721internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16722 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16723 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16724 T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16725 T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16726 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16727 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16728 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16729 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
16730 return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16731 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16732 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16733 T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
16734 v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16735 v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16736 v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
16737}
16738
16739template <typename T1, typename T2, typename T3, typename T4, typename T5,
16740 typename T6, typename T7, typename T8, typename T9, typename T10,
16741 typename T11, typename T12, typename T13, typename T14, typename T15,
16742 typename T16, typename T17, typename T18, typename T19, typename T20,
16743 typename T21, typename T22, typename T23, typename T24, typename T25,
16744 typename T26, typename T27, typename T28, typename T29, typename T30,
16745 typename T31, typename T32, typename T33, typename T34, typename T35,
16746 typename T36, typename T37, typename T38, typename T39, typename T40,
16747 typename T41, typename T42, typename T43, typename T44, typename T45,
16748 typename T46, typename T47, typename T48>
16749internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16750 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16751 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16752 T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16753 T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16754 T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16755 T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16756 T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16757 T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
16758 T48 v48) {
16759 return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16760 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16761 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16762 T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
16763 v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16764 v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
16765 v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
16766}
16767
16768template <typename T1, typename T2, typename T3, typename T4, typename T5,
16769 typename T6, typename T7, typename T8, typename T9, typename T10,
16770 typename T11, typename T12, typename T13, typename T14, typename T15,
16771 typename T16, typename T17, typename T18, typename T19, typename T20,
16772 typename T21, typename T22, typename T23, typename T24, typename T25,
16773 typename T26, typename T27, typename T28, typename T29, typename T30,
16774 typename T31, typename T32, typename T33, typename T34, typename T35,
16775 typename T36, typename T37, typename T38, typename T39, typename T40,
16776 typename T41, typename T42, typename T43, typename T44, typename T45,
16777 typename T46, typename T47, typename T48, typename T49>
16778internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16779 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16780 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16781 T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16782 T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16783 T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16784 T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16785 T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
16786 T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
16787 T47 v47, T48 v48, T49 v49) {
16788 return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16789 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16790 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16791 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
16792 v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16793 v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
16794 v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
16795}
16796
16797template <typename T1, typename T2, typename T3, typename T4, typename T5,
16798 typename T6, typename T7, typename T8, typename T9, typename T10,
16799 typename T11, typename T12, typename T13, typename T14, typename T15,
16800 typename T16, typename T17, typename T18, typename T19, typename T20,
16801 typename T21, typename T22, typename T23, typename T24, typename T25,
16802 typename T26, typename T27, typename T28, typename T29, typename T30,
16803 typename T31, typename T32, typename T33, typename T34, typename T35,
16804 typename T36, typename T37, typename T38, typename T39, typename T40,
16805 typename T41, typename T42, typename T43, typename T44, typename T45,
16806 typename T46, typename T47, typename T48, typename T49, typename T50>
16807internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16808 T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16809 T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16810 T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16811 T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16812 T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16813 T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16814 T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
16815 T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
16816 T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
16817 return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16818 T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16819 T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16820 T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
16821 v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16822 v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16823 v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
16824 v48, v49, v50);
16825}
16826
16827// Bool() allows generating tests with parameters in a set of (false, true).
16828//
16829// Synopsis:
16830// Bool()
16831// - returns a generator producing sequences with elements {false, true}.
16832//
16833// It is useful when testing code that depends on Boolean flags. Combinations
16834// of multiple flags can be tested when several Bool()'s are combined using
16835// Combine() function.
16836//
16837// In the following example all tests in the test case FlagDependentTest
16838// will be instantiated twice with parameters false and true.
16839//
16840// class FlagDependentTest : public testing::TestWithParam<bool> {
16841// virtual void SetUp() {
16842// external_flag = GetParam();
16843// }
16844// }
16845// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
16846//
16847inline internal::ParamGenerator<bool> Bool() {
16848 return Values(false, true);
16849}
16850
16851# if GTEST_HAS_COMBINE
16852// Combine() allows the user to combine two or more sequences to produce
16853// values of a Cartesian product of those sequences' elements.
16854//
16855// Synopsis:
16856// Combine(gen1, gen2, ..., genN)
16857// - returns a generator producing sequences with elements coming from
16858// the Cartesian product of elements from the sequences generated by
16859// gen1, gen2, ..., genN. The sequence elements will have a type of
16860// tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
16861// of elements from sequences produces by gen1, gen2, ..., genN.
16862//
16863// Combine can have up to 10 arguments. This number is currently limited
16864// by the maximum number of elements in the tuple implementation used by Google
16865// Test.
16866//
16867// Example:
16868//
16869// This will instantiate tests in test case AnimalTest each one with
16870// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
16871// tuple("dog", BLACK), and tuple("dog", WHITE):
16872//
16873// enum Color { BLACK, GRAY, WHITE };
16874// class AnimalTest
16875// : public testing::TestWithParam<tuple<const char*, Color> > {...};
16876//
16877// TEST_P(AnimalTest, AnimalLooksNice) {...}
16878//
16879// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
16880// Combine(Values("cat", "dog"),
16881// Values(BLACK, WHITE)));
16882//
16883// This will instantiate tests in FlagDependentTest with all variations of two
16884// Boolean flags:
16885//
16886// class FlagDependentTest
16887// : public testing::TestWithParam<tuple<bool, bool> > {
16888// virtual void SetUp() {
16889// // Assigns external_flag_1 and external_flag_2 values from the tuple.
16890// tie(external_flag_1, external_flag_2) = GetParam();
16891// }
16892// };
16893//
16894// TEST_P(FlagDependentTest, TestFeature1) {
16895// // Test your code using external_flag_1 and external_flag_2 here.
16896// }
16897// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
16898// Combine(Bool(), Bool()));
16899//
16900template <typename Generator1, typename Generator2>
16901internal::CartesianProductHolder2<Generator1, Generator2> Combine(
16902 const Generator1& g1, const Generator2& g2) {
16903 return internal::CartesianProductHolder2<Generator1, Generator2>(
16904 g1, g2);
16905}
16906
16907template <typename Generator1, typename Generator2, typename Generator3>
16908internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
16909 const Generator1& g1, const Generator2& g2, const Generator3& g3) {
16910 return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
16911 g1, g2, g3);
16912}
16913
16914template <typename Generator1, typename Generator2, typename Generator3,
16915 typename Generator4>
16916internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16917 Generator4> Combine(
16918 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16919 const Generator4& g4) {
16920 return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16921 Generator4>(
16922 g1, g2, g3, g4);
16923}
16924
16925template <typename Generator1, typename Generator2, typename Generator3,
16926 typename Generator4, typename Generator5>
16927internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16928 Generator4, Generator5> Combine(
16929 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16930 const Generator4& g4, const Generator5& g5) {
16931 return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16932 Generator4, Generator5>(
16933 g1, g2, g3, g4, g5);
16934}
16935
16936template <typename Generator1, typename Generator2, typename Generator3,
16937 typename Generator4, typename Generator5, typename Generator6>
16938internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16939 Generator4, Generator5, Generator6> Combine(
16940 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16941 const Generator4& g4, const Generator5& g5, const Generator6& g6) {
16942 return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16943 Generator4, Generator5, Generator6>(
16944 g1, g2, g3, g4, g5, g6);
16945}
16946
16947template <typename Generator1, typename Generator2, typename Generator3,
16948 typename Generator4, typename Generator5, typename Generator6,
16949 typename Generator7>
16950internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16951 Generator4, Generator5, Generator6, Generator7> Combine(
16952 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16953 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16954 const Generator7& g7) {
16955 return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16956 Generator4, Generator5, Generator6, Generator7>(
16957 g1, g2, g3, g4, g5, g6, g7);
16958}
16959
16960template <typename Generator1, typename Generator2, typename Generator3,
16961 typename Generator4, typename Generator5, typename Generator6,
16962 typename Generator7, typename Generator8>
16963internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16964 Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
16965 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16966 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16967 const Generator7& g7, const Generator8& g8) {
16968 return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16969 Generator4, Generator5, Generator6, Generator7, Generator8>(
16970 g1, g2, g3, g4, g5, g6, g7, g8);
16971}
16972
16973template <typename Generator1, typename Generator2, typename Generator3,
16974 typename Generator4, typename Generator5, typename Generator6,
16975 typename Generator7, typename Generator8, typename Generator9>
16976internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16977 Generator4, Generator5, Generator6, Generator7, Generator8,
16978 Generator9> Combine(
16979 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16980 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16981 const Generator7& g7, const Generator8& g8, const Generator9& g9) {
16982 return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16983 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
16984 g1, g2, g3, g4, g5, g6, g7, g8, g9);
16985}
16986
16987template <typename Generator1, typename Generator2, typename Generator3,
16988 typename Generator4, typename Generator5, typename Generator6,
16989 typename Generator7, typename Generator8, typename Generator9,
16990 typename Generator10>
16991internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16992 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16993 Generator10> Combine(
16994 const Generator1& g1, const Generator2& g2, const Generator3& g3,
16995 const Generator4& g4, const Generator5& g5, const Generator6& g6,
16996 const Generator7& g7, const Generator8& g8, const Generator9& g9,
16997 const Generator10& g10) {
16998 return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16999 Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
17000 Generator10>(
17001 g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
17002}
17003# endif // GTEST_HAS_COMBINE
17004
17005
17006
17007# define TEST_P(test_case_name, test_name) \
17008 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
17009 : public test_case_name { \
17010 public: \
17011 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
17012 virtual void TestBody(); \
17013 private: \
17014 static int AddToRegistry() { \
17015 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
17016 GetTestCasePatternHolder<test_case_name>(\
17017 #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
17018 #test_case_name, \
17019 #test_name, \
17020 new ::testing::internal::TestMetaFactory< \
17021 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
17022 return 0; \
17023 } \
17024 static int gtest_registering_dummy_; \
17025 GTEST_DISALLOW_COPY_AND_ASSIGN_(\
17026 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
17027 }; \
17028 int GTEST_TEST_CLASS_NAME_(test_case_name, \
17029 test_name)::gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
17030 GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
17031 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
17032
17033# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
17034 ::testing::internal::ParamGenerator<test_case_name::ParamType> \
17035 gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
17036 int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
17037 ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
17038 GetTestCasePatternHolder<test_case_name>(\
17039 #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
17040 #prefix, \
17041 &gtest_##prefix##test_case_name##_EvalGenerator_, \
17042 __FILE__, __LINE__)
17043
17044} // namespace testing
17045
17046#endif // GTEST_HAS_PARAM_TEST
17047
17048#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
17049// Copyright 2006, Google Inc.
17050// All rights reserved.
17051//
17052// Redistribution and use in source and binary forms, with or without
17053// modification, are permitted provided that the following conditions are
17054// met:
17055//
17056// * Redistributions of source code must retain the above copyright
17057// notice, this list of conditions and the following disclaimer.
17058// * Redistributions in binary form must reproduce the above
17059// copyright notice, this list of conditions and the following disclaimer
17060// in the documentation and/or other materials provided with the
17061// distribution.
17062// * Neither the name of Google Inc. nor the names of its
17063// contributors may be used to endorse or promote products derived from
17064// this software without specific prior written permission.
17065//
17066// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17067// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17068// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17069// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17070// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17071// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17072// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17073// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17074// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17075// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17076// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17077//
17078// Author: wan@google.com (Zhanyong Wan)
17079//
17080// Google C++ Testing Framework definitions useful in production code.
17081
17082#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17083#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17084
17085// When you need to test the private or protected members of a class,
17086// use the FRIEND_TEST macro to declare your tests as friends of the
17087// class. For example:
17088//
17089// class MyClass {
17090// private:
17091// void MyMethod();
17092// FRIEND_TEST(MyClassTest, MyMethod);
17093// };
17094//
17095// class MyClassTest : public testing::Test {
17096// // ...
17097// };
17098//
17099// TEST_F(MyClassTest, MyMethod) {
17100// // Can call MyClass::MyMethod() here.
17101// }
17102
17103#define FRIEND_TEST(test_case_name, test_name)\
17104friend class test_case_name##_##test_name##_Test
17105
17106#endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17107// Copyright 2008, Google Inc.
17108// All rights reserved.
17109//
17110// Redistribution and use in source and binary forms, with or without
17111// modification, are permitted provided that the following conditions are
17112// met:
17113//
17114// * Redistributions of source code must retain the above copyright
17115// notice, this list of conditions and the following disclaimer.
17116// * Redistributions in binary form must reproduce the above
17117// copyright notice, this list of conditions and the following disclaimer
17118// in the documentation and/or other materials provided with the
17119// distribution.
17120// * Neither the name of Google Inc. nor the names of its
17121// contributors may be used to endorse or promote products derived from
17122// this software without specific prior written permission.
17123//
17124// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17125// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17126// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17127// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17128// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17129// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17130// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17131// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17132// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17133// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17134// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17135//
17136// Author: mheule@google.com (Markus Heule)
17137//
17138
17139#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17140#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17141
17142#include <iosfwd>
17143#include <vector>
17144
17145namespace testing {
17146
17147// A copyable object representing the result of a test part (i.e. an
17148// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
17149//
17150// Don't inherit from TestPartResult as its destructor is not virtual.
17151class GTEST_API_ TestPartResult {
17152 public:
17153 // The possible outcomes of a test part (i.e. an assertion or an
17154 // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
17155 enum Type {
17156 kSuccess, // Succeeded.
17157 kNonFatalFailure, // Failed but the test can continue.
17158 kFatalFailure // Failed and the test should be terminated.
17159 };
17160
17161 // C'tor. TestPartResult does NOT have a default constructor.
17162 // Always use this constructor (with parameters) to create a
17163 // TestPartResult object.
17164 TestPartResult(Type a_type,
17165 const char* a_file_name,
17166 int a_line_number,
17167 const char* a_message)
17168 : type_(a_type),
17169 file_name_(a_file_name == NULL ? "" : a_file_name),
17170 line_number_(a_line_number),
17171 summary_(ExtractSummary(a_message)),
17172 message_(a_message) {
17173 }
17174
17175 // Gets the outcome of the test part.
17176 Type type() const { return type_; }
17177
17178 // Gets the name of the source file where the test part took place, or
17179 // NULL if it's unknown.
17180 const char* file_name() const {
17181 return file_name_.empty() ? NULL : file_name_.c_str();
17182 }
17183
17184 // Gets the line in the source file where the test part took place,
17185 // or -1 if it's unknown.
17186 int line_number() const { return line_number_; }
17187
17188 // Gets the summary of the failure message.
17189 const char* summary() const { return summary_.c_str(); }
17190
17191 // Gets the message associated with the test part.
17192 const char* message() const { return message_.c_str(); }
17193
17194 // Returns true iff the test part passed.
17195 bool passed() const { return type_ == kSuccess; }
17196
17197 // Returns true iff the test part failed.
17198 bool failed() const { return type_ != kSuccess; }
17199
17200 // Returns true iff the test part non-fatally failed.
17201 bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
17202
17203 // Returns true iff the test part fatally failed.
17204 bool fatally_failed() const { return type_ == kFatalFailure; }
17205
17206 private:
17207 Type type_;
17208
17209 // Gets the summary of the failure message by omitting the stack
17210 // trace in it.
17211 static std::string ExtractSummary(const char* message);
17212
17213 // The name of the source file where the test part took place, or
17214 // "" if the source file is unknown.
17215 std::string file_name_;
17216 // The line in the source file where the test part took place, or -1
17217 // if the line number is unknown.
17218 int line_number_;
17219 std::string summary_; // The test failure summary.
17220 std::string message_; // The test failure message.
17221};
17222
17223// Prints a TestPartResult object.
17224std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
17225
17226// An array of TestPartResult objects.
17227//
17228// Don't inherit from TestPartResultArray as its destructor is not
17229// virtual.
17230class GTEST_API_ TestPartResultArray {
17231 public:
17232 TestPartResultArray() {}
17233
17234 // Appends the given TestPartResult to the array.
17235 void Append(const TestPartResult& result);
17236
17237 // Returns the TestPartResult at the given index (0-based).
17238 const TestPartResult& GetTestPartResult(int index) const;
17239
17240 // Returns the number of TestPartResult objects in the array.
17241 int size() const;
17242
17243 private:
17244 std::vector<TestPartResult> array_;
17245
17246 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
17247};
17248
17249// This interface knows how to report a test part result.
17250class GTEST_API_ TestPartResultReporterInterface {
17251 public:
17252 virtual ~TestPartResultReporterInterface() {}
17253
17254 virtual void ReportTestPartResult(const TestPartResult& result) = 0;
17255};
17256
17257namespace internal {
17258
17259// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
17260// statement generates new fatal failures. To do so it registers itself as the
17261// current test part result reporter. Besides checking if fatal failures were
17262// reported, it only delegates the reporting to the former result reporter.
17263// The original result reporter is restored in the destructor.
17264// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17265class GTEST_API_ HasNewFatalFailureHelper
17266 : public TestPartResultReporterInterface {
17267 public:
17268 HasNewFatalFailureHelper();
17269 virtual ~HasNewFatalFailureHelper();
17270 virtual void ReportTestPartResult(const TestPartResult& result);
17271 bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
17272 private:
17273 bool has_new_fatal_failure_;
17274 TestPartResultReporterInterface* original_reporter_;
17275
17276 GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
17277};
17278
17279} // namespace internal
17280
17281} // namespace testing
17282
17283#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17284// Copyright 2008 Google Inc.
17285// All Rights Reserved.
17286//
17287// Redistribution and use in source and binary forms, with or without
17288// modification, are permitted provided that the following conditions are
17289// met:
17290//
17291// * Redistributions of source code must retain the above copyright
17292// notice, this list of conditions and the following disclaimer.
17293// * Redistributions in binary form must reproduce the above
17294// copyright notice, this list of conditions and the following disclaimer
17295// in the documentation and/or other materials provided with the
17296// distribution.
17297// * Neither the name of Google Inc. nor the names of its
17298// contributors may be used to endorse or promote products derived from
17299// this software without specific prior written permission.
17300//
17301// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17302// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17303// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17304// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17305// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17306// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17307// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17308// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17309// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17310// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17311// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17312//
17313// Author: wan@google.com (Zhanyong Wan)
17314
17315#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17316#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17317
17318// This header implements typed tests and type-parameterized tests.
17319
17320// Typed (aka type-driven) tests repeat the same test for types in a
17321// list. You must know which types you want to test with when writing
17322// typed tests. Here's how you do it:
17323
17324#if 0
17325
17326// First, define a fixture class template. It should be parameterized
17327// by a type. Remember to derive it from testing::Test.
17328template <typename T>
17329class FooTest : public testing::Test {
17330 public:
17331 ...
17332 typedef std::list<T> List;
17333 static T shared_;
17334 T value_;
17335};
17336
17337// Next, associate a list of types with the test case, which will be
17338// repeated for each type in the list. The typedef is necessary for
17339// the macro to parse correctly.
17340typedef testing::Types<char, int, unsigned int> MyTypes;
17341TYPED_TEST_CASE(FooTest, MyTypes);
17342
17343// If the type list contains only one type, you can write that type
17344// directly without Types<...>:
17345// TYPED_TEST_CASE(FooTest, int);
17346
17347// Then, use TYPED_TEST() instead of TEST_F() to define as many typed
17348// tests for this test case as you want.
17349TYPED_TEST(FooTest, DoesBlah) {
17350 // Inside a test, refer to TypeParam to get the type parameter.
17351 // Since we are inside a derived class template, C++ requires use to
17352 // visit the members of FooTest via 'this'.
17353 TypeParam n = this->value_;
17354
17355 // To visit static members of the fixture, add the TestFixture::
17356 // prefix.
17357 n += TestFixture::shared_;
17358
17359 // To refer to typedefs in the fixture, add the "typename
17360 // TestFixture::" prefix.
17361 typename TestFixture::List values;
17362 values.push_back(n);
17363 ...
17364}
17365
17366TYPED_TEST(FooTest, HasPropertyA) { ... }
17367
17368#endif // 0
17369
17370// Type-parameterized tests are abstract test patterns parameterized
17371// by a type. Compared with typed tests, type-parameterized tests
17372// allow you to define the test pattern without knowing what the type
17373// parameters are. The defined pattern can be instantiated with
17374// different types any number of times, in any number of translation
17375// units.
17376//
17377// If you are designing an interface or concept, you can define a
17378// suite of type-parameterized tests to verify properties that any
17379// valid implementation of the interface/concept should have. Then,
17380// each implementation can easily instantiate the test suite to verify
17381// that it conforms to the requirements, without having to write
17382// similar tests repeatedly. Here's an example:
17383
17384#if 0
17385
17386// First, define a fixture class template. It should be parameterized
17387// by a type. Remember to derive it from testing::Test.
17388template <typename T>
17389class FooTest : public testing::Test {
17390 ...
17391};
17392
17393// Next, declare that you will define a type-parameterized test case
17394// (the _P suffix is for "parameterized" or "pattern", whichever you
17395// prefer):
17396TYPED_TEST_CASE_P(FooTest);
17397
17398// Then, use TYPED_TEST_P() to define as many type-parameterized tests
17399// for this type-parameterized test case as you want.
17400TYPED_TEST_P(FooTest, DoesBlah) {
17401 // Inside a test, refer to TypeParam to get the type parameter.
17402 TypeParam n = 0;
17403 ...
17404}
17405
17406TYPED_TEST_P(FooTest, HasPropertyA) { ... }
17407
17408// Now the tricky part: you need to register all test patterns before
17409// you can instantiate them. The first argument of the macro is the
17410// test case name; the rest are the names of the tests in this test
17411// case.
17412REGISTER_TYPED_TEST_CASE_P(FooTest,
17413 DoesBlah, HasPropertyA);
17414
17415// Finally, you are free to instantiate the pattern with the types you
17416// want. If you put the above code in a header file, you can #include
17417// it in multiple C++ source files and instantiate it multiple times.
17418//
17419// To distinguish different instances of the pattern, the first
17420// argument to the INSTANTIATE_* macro is a prefix that will be added
17421// to the actual test case name. Remember to pick unique prefixes for
17422// different instances.
17423typedef testing::Types<char, int, unsigned int> MyTypes;
17424INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
17425
17426// If the type list contains only one type, you can write that type
17427// directly without Types<...>:
17428// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
17429
17430#endif // 0
17431
17432
17433// Implements typed tests.
17434
17435#if GTEST_HAS_TYPED_TEST
17436
17437// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17438//
17439// Expands to the name of the typedef for the type parameters of the
17440// given test case.
17441# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
17442
17443// The 'Types' template argument below must have spaces around it
17444// since some compilers may choke on '>>' when passing a template
17445// instance (e.g. Types<int>)
17446# define TYPED_TEST_CASE(CaseName, Types) \
17447 typedef ::testing::internal::TypeList< Types >::type \
17448 GTEST_TYPE_PARAMS_(CaseName)
17449
17450# define TYPED_TEST(CaseName, TestName) \
17451 template <typename gtest_TypeParam_> \
17452 class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
17453 : public CaseName<gtest_TypeParam_> { \
17454 private: \
17455 typedef CaseName<gtest_TypeParam_> TestFixture; \
17456 typedef gtest_TypeParam_ TypeParam; \
17457 virtual void TestBody(); \
17458 }; \
17459 bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
17460 ::testing::internal::TypeParameterizedTest< \
17461 CaseName, \
17462 ::testing::internal::TemplateSel< \
17463 GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
17464 GTEST_TYPE_PARAMS_(CaseName)>::Register(\
17465 "", #CaseName, #TestName, 0); \
17466 template <typename gtest_TypeParam_> \
17467 void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
17468
17469#endif // GTEST_HAS_TYPED_TEST
17470
17471// Implements type-parameterized tests.
17472
17473#if GTEST_HAS_TYPED_TEST_P
17474
17475// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17476//
17477// Expands to the namespace name that the type-parameterized tests for
17478// the given type-parameterized test case are defined in. The exact
17479// name of the namespace is subject to change without notice.
17480# define GTEST_CASE_NAMESPACE_(TestCaseName) \
17481 gtest_case_##TestCaseName##_
17482
17483// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17484//
17485// Expands to the name of the variable used to remember the names of
17486// the defined tests in the given test case.
17487# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
17488 gtest_typed_test_case_p_state_##TestCaseName##_
17489
17490// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
17491//
17492// Expands to the name of the variable used to remember the names of
17493// the registered tests in the given test case.
17494# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
17495 gtest_registered_test_names_##TestCaseName##_
17496
17497// The variables defined in the type-parameterized test macros are
17498// static as typically these macros are used in a .h file that can be
17499// #included in multiple translation units linked together.
17500# define TYPED_TEST_CASE_P(CaseName) \
17501 static ::testing::internal::TypedTestCasePState \
17502 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
17503
17504# define TYPED_TEST_P(CaseName, TestName) \
17505 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17506 template <typename gtest_TypeParam_> \
17507 class TestName : public CaseName<gtest_TypeParam_> { \
17508 private: \
17509 typedef CaseName<gtest_TypeParam_> TestFixture; \
17510 typedef gtest_TypeParam_ TypeParam; \
17511 virtual void TestBody(); \
17512 }; \
17513 static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
17514 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
17515 __FILE__, __LINE__, #CaseName, #TestName); \
17516 } \
17517 template <typename gtest_TypeParam_> \
17518 void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
17519
17520# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
17521 namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17522 typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
17523 } \
17524 static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
17525 GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
17526 __FILE__, __LINE__, #__VA_ARGS__)
17527
17528// The 'Types' template argument below must have spaces around it
17529// since some compilers may choke on '>>' when passing a template
17530// instance (e.g. Types<int>)
17531# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
17532 bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
17533 ::testing::internal::TypeParameterizedTestCase<CaseName, \
17534 GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
17535 ::testing::internal::TypeList< Types >::type>::Register(\
17536 #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
17537
17538#endif // GTEST_HAS_TYPED_TEST_P
17539
17540#endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17541
17542// Depending on the platform, different string classes are available.
17543// On Linux, in addition to ::std::string, Google also makes use of
17544// class ::string, which has the same interface as ::std::string, but
17545// has a different implementation.
17546//
17547// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
17548// ::string is available AND is a distinct type to ::std::string, or
17549// define it to 0 to indicate otherwise.
17550//
17551// If the user's ::std::string and ::string are the same class due to
17552// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
17553//
17554// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
17555// heuristically.
17556
17557namespace testing {
17558
17559// Declares the flags.
17560
17561// This flag temporary enables the disabled tests.
17562GTEST_DECLARE_bool_(also_run_disabled_tests);
17563
17564// This flag brings the debugger on an assertion failure.
17565GTEST_DECLARE_bool_(break_on_failure);
17566
17567// This flag controls whether Google Test catches all test-thrown exceptions
17568// and logs them as failures.
17569GTEST_DECLARE_bool_(catch_exceptions);
17570
17571// This flag enables using colors in terminal output. Available values are
17572// "yes" to enable colors, "no" (disable colors), or "auto" (the default)
17573// to let Google Test decide.
17574GTEST_DECLARE_string_(color);
17575
17576// This flag sets up the filter to select by name using a glob pattern
17577// the tests to run. If the filter is not given all tests are executed.
17578GTEST_DECLARE_string_(filter);
17579
17580// OpenCV extension: same as filter, but for the parameters string.
17581GTEST_DECLARE_string_(param_filter);
17582
17583// This flag causes the Google Test to list tests. None of the tests listed
17584// are actually run if the flag is provided.
17585GTEST_DECLARE_bool_(list_tests);
17586
17587// This flag controls whether Google Test emits a detailed XML report to a file
17588// in addition to its normal textual output.
17589GTEST_DECLARE_string_(output);
17590
17591// This flags control whether Google Test prints the elapsed time for each
17592// test.
17593GTEST_DECLARE_bool_(print_time);
17594
17595// This flag specifies the random number seed.
17596GTEST_DECLARE_int32_(random_seed);
17597
17598// This flag sets how many times the tests are repeated. The default value
17599// is 1. If the value is -1 the tests are repeating forever.
17600GTEST_DECLARE_int32_(repeat);
17601
17602// This flag controls whether Google Test includes Google Test internal
17603// stack frames in failure stack traces.
17604GTEST_DECLARE_bool_(show_internal_stack_frames);
17605
17606// When this flag is specified, tests' order is randomized on every iteration.
17607GTEST_DECLARE_bool_(shuffle);
17608
17609// This flag specifies the maximum number of stack frames to be
17610// printed in a failure message.
17611GTEST_DECLARE_int32_(stack_trace_depth);
17612
17613// When this flag is specified, a failed assertion will throw an
17614// exception if exceptions are enabled, or exit the program with a
17615// non-zero code otherwise.
17616GTEST_DECLARE_bool_(throw_on_failure);
17617
17618// When this flag is set with a "host:port" string, on supported
17619// platforms test results are streamed to the specified port on
17620// the specified host machine.
17621GTEST_DECLARE_string_(stream_result_to);
17622
17623// The upper limit for valid stack trace depths.
17624const int kMaxStackTraceDepth = 100;
17625
17626namespace internal {
17627
17628class AssertHelper;
17629class DefaultGlobalTestPartResultReporter;
17630class ExecDeathTest;
17631class NoExecDeathTest;
17632class FinalSuccessChecker;
17633class GTestFlagSaver;
17634class StreamingListenerTest;
17635class TestResultAccessor;
17636class TestEventListenersAccessor;
17637class TestEventRepeater;
17638class UnitTestRecordPropertyTestHelper;
17639class WindowsDeathTest;
17640class UnitTestImpl* GetUnitTestImpl();
17641void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
17642 const std::string& message);
17643
17644} // namespace internal
17645
17646// The friend relationship of some of these classes is cyclic.
17647// If we don't forward declare them the compiler might confuse the classes
17648// in friendship clauses with same named classes on the scope.
17649class Test;
17650class TestCase;
17651class TestInfo;
17652class UnitTest;
17653
17654// A class for indicating whether an assertion was successful. When
17655// the assertion wasn't successful, the AssertionResult object
17656// remembers a non-empty message that describes how it failed.
17657//
17658// To create an instance of this class, use one of the factory functions
17659// (AssertionSuccess() and AssertionFailure()).
17660//
17661// This class is useful for two purposes:
17662// 1. Defining predicate functions to be used with Boolean test assertions
17663// EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
17664// 2. Defining predicate-format functions to be
17665// used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
17666//
17667// For example, if you define IsEven predicate:
17668//
17669// testing::AssertionResult IsEven(int n) {
17670// if ((n % 2) == 0)
17671// return testing::AssertionSuccess();
17672// else
17673// return testing::AssertionFailure() << n << " is odd";
17674// }
17675//
17676// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
17677// will print the message
17678//
17679// Value of: IsEven(Fib(5))
17680// Actual: false (5 is odd)
17681// Expected: true
17682//
17683// instead of a more opaque
17684//
17685// Value of: IsEven(Fib(5))
17686// Actual: false
17687// Expected: true
17688//
17689// in case IsEven is a simple Boolean predicate.
17690//
17691// If you expect your predicate to be reused and want to support informative
17692// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
17693// about half as often as positive ones in our tests), supply messages for
17694// both success and failure cases:
17695//
17696// testing::AssertionResult IsEven(int n) {
17697// if ((n % 2) == 0)
17698// return testing::AssertionSuccess() << n << " is even";
17699// else
17700// return testing::AssertionFailure() << n << " is odd";
17701// }
17702//
17703// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
17704//
17705// Value of: IsEven(Fib(6))
17706// Actual: true (8 is even)
17707// Expected: false
17708//
17709// NB: Predicates that support negative Boolean assertions have reduced
17710// performance in positive ones so be careful not to use them in tests
17711// that have lots (tens of thousands) of positive Boolean assertions.
17712//
17713// To use this class with EXPECT_PRED_FORMAT assertions such as:
17714//
17715// // Verifies that Foo() returns an even number.
17716// EXPECT_PRED_FORMAT1(IsEven, Foo());
17717//
17718// you need to define:
17719//
17720// testing::AssertionResult IsEven(const char* expr, int n) {
17721// if ((n % 2) == 0)
17722// return testing::AssertionSuccess();
17723// else
17724// return testing::AssertionFailure()
17725// << "Expected: " << expr << " is even\n Actual: it's " << n;
17726// }
17727//
17728// If Foo() returns 5, you will see the following message:
17729//
17730// Expected: Foo() is even
17731// Actual: it's 5
17732//
17733class GTEST_API_ AssertionResult {
17734 public:
17735 // Copy constructor.
17736 // Used in EXPECT_TRUE/FALSE(assertion_result).
17737 AssertionResult(const AssertionResult& other);
17738 // Used in the EXPECT_TRUE/FALSE(bool_expression).
17739 explicit AssertionResult(bool success) : success_(success) {}
17740
17741 // Returns true iff the assertion succeeded.
17742 operator bool() const { return success_; } // NOLINT
17743
17744 // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
17745 AssertionResult operator!() const;
17746
17747 // Returns the text streamed into this AssertionResult. Test assertions
17748 // use it when they fail (i.e., the predicate's outcome doesn't match the
17749 // assertion's expectation). When nothing has been streamed into the
17750 // object, returns an empty string.
17751 const char* message() const {
17752 return message_.get() != NULL ? message_->c_str() : "";
17753 }
17754 // TODO(vladl@google.com): Remove this after making sure no clients use it.
17755 // Deprecated; please use message() instead.
17756 const char* failure_message() const { return message(); }
17757
17758 // Streams a custom failure message into this object.
17759 template <typename T> AssertionResult& operator<<(const T& value) {
17760 AppendMessage(Message() << value);
17761 return *this;
17762 }
17763
17764 // Allows streaming basic output manipulators such as endl or flush into
17765 // this object.
17766 AssertionResult& operator<<(
17767 ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
17768 AppendMessage(Message() << basic_manipulator);
17769 return *this;
17770 }
17771
17772 private:
17773 // Appends the contents of message to message_.
17774 void AppendMessage(const Message& a_message) {
17775 if (message_.get() == NULL)
17776 message_.reset(new ::std::string);
17777 message_->append(a_message.GetString().c_str());
17778 }
17779
17780 // Stores result of the assertion predicate.
17781 bool success_;
17782 // Stores the message describing the condition in case the expectation
17783 // construct is not satisfied with the predicate's outcome.
17784 // Referenced via a pointer to avoid taking too much stack frame space
17785 // with test assertions.
17786 internal::scoped_ptr< ::std::string> message_;
17787
17788 GTEST_DISALLOW_ASSIGN_(AssertionResult);
17789};
17790
17791// Makes a successful assertion result.
17792GTEST_API_ AssertionResult AssertionSuccess();
17793
17794// Makes a failed assertion result.
17795GTEST_API_ AssertionResult AssertionFailure();
17796
17797// Makes a failed assertion result with the given failure message.
17798// Deprecated; use AssertionFailure() << msg.
17799GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
17800
17801// The abstract class that all tests inherit from.
17802//
17803// In Google Test, a unit test program contains one or many TestCases, and
17804// each TestCase contains one or many Tests.
17805//
17806// When you define a test using the TEST macro, you don't need to
17807// explicitly derive from Test - the TEST macro automatically does
17808// this for you.
17809//
17810// The only time you derive from Test is when defining a test fixture
17811// to be used a TEST_F. For example:
17812//
17813// class FooTest : public testing::Test {
17814// protected:
17815// virtual void SetUp() { ... }
17816// virtual void TearDown() { ... }
17817// ...
17818// };
17819//
17820// TEST_F(FooTest, Bar) { ... }
17821// TEST_F(FooTest, Baz) { ... }
17822//
17823// Test is not copyable.
17824class GTEST_API_ Test {
17825 public:
17826 friend class TestInfo;
17827
17828 // Defines types for pointers to functions that set up and tear down
17829 // a test case.
17830 typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
17831 typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
17832
17833 // The d'tor is virtual as we intend to inherit from Test.
17834 virtual ~Test();
17835
17836 // Sets up the stuff shared by all tests in this test case.
17837 //
17838 // Google Test will call Foo::SetUpTestCase() before running the first
17839 // test in test case Foo. Hence a sub-class can define its own
17840 // SetUpTestCase() method to shadow the one defined in the super
17841 // class.
17842 static void SetUpTestCase() {}
17843
17844 // Tears down the stuff shared by all tests in this test case.
17845 //
17846 // Google Test will call Foo::TearDownTestCase() after running the last
17847 // test in test case Foo. Hence a sub-class can define its own
17848 // TearDownTestCase() method to shadow the one defined in the super
17849 // class.
17850 static void TearDownTestCase() {}
17851
17852 // Returns true iff the current test has a fatal failure.
17853 static bool HasFatalFailure();
17854
17855 // Returns true iff the current test has a non-fatal failure.
17856 static bool HasNonfatalFailure();
17857
17858 // Returns true iff the current test has a (either fatal or
17859 // non-fatal) failure.
17860 static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
17861
17862 // Logs a property for the current test, test case, or for the entire
17863 // invocation of the test program when used outside of the context of a
17864 // test case. Only the last value for a given key is remembered. These
17865 // are public static so they can be called from utility functions that are
17866 // not members of the test fixture. Calls to RecordProperty made during
17867 // lifespan of the test (from the moment its constructor starts to the
17868 // moment its destructor finishes) will be output in XML as attributes of
17869 // the <testcase> element. Properties recorded from fixture's
17870 // SetUpTestCase or TearDownTestCase are logged as attributes of the
17871 // corresponding <testsuite> element. Calls to RecordProperty made in the
17872 // global context (before or after invocation of RUN_ALL_TESTS and from
17873 // SetUp/TearDown method of Environment objects registered with Google
17874 // Test) will be output as attributes of the <testsuites> element.
17875 static void RecordProperty(const std::string& key, const std::string& value);
17876 static void RecordProperty(const std::string& key, int value);
17877
17878 protected:
17879 // Creates a Test object.
17880 Test();
17881
17882 // Sets up the test fixture.
17883 virtual void SetUp();
17884
17885 // Tears down the test fixture.
17886 virtual void TearDown();
17887
17888 private:
17889 // Returns true iff the current test has the same fixture class as
17890 // the first test in the current test case.
17891 static bool HasSameFixtureClass();
17892
17893 // Runs the test after the test fixture has been set up.
17894 //
17895 // A sub-class must implement this to define the test logic.
17896 //
17897 // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
17898 // Instead, use the TEST or TEST_F macro.
17899 virtual void TestBody() = 0;
17900
17901 // Sets up, executes, and tears down the test.
17902 void Run();
17903
17904 // Deletes self. We deliberately pick an unusual name for this
17905 // internal method to avoid clashing with names used in user TESTs.
17906 void DeleteSelf_() { delete this; }
17907
17908 // Uses a GTestFlagSaver to save and restore all Google Test flags.
17909 const internal::GTestFlagSaver* const gtest_flag_saver_;
17910
17911 // Often a user mis-spells SetUp() as Setup() and spends a long time
17912 // wondering why it is never called by Google Test. The declaration of
17913 // the following method is solely for catching such an error at
17914 // compile time:
17915 //
17916 // - The return type is deliberately chosen to be not void, so it
17917 // will be a conflict if a user declares void Setup() in his test
17918 // fixture.
17919 //
17920 // - This method is private, so it will be another compiler error
17921 // if a user calls it from his test fixture.
17922 //
17923 // DO NOT OVERRIDE THIS FUNCTION.
17924 //
17925 // If you see an error about overriding the following function or
17926 // about it being private, you have mis-spelled SetUp() as Setup().
17927 struct Setup_should_be_spelled_SetUp {};
17928 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
17929
17930 // We disallow copying Tests.
17931 GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
17932};
17933
17934typedef internal::TimeInMillis TimeInMillis;
17935
17936// A copyable object representing a user specified test property which can be
17937// output as a key/value string pair.
17938//
17939// Don't inherit from TestProperty as its destructor is not virtual.
17940class TestProperty {
17941 public:
17942 // C'tor. TestProperty does NOT have a default constructor.
17943 // Always use this constructor (with parameters) to create a
17944 // TestProperty object.
17945 TestProperty(const std::string& a_key, const std::string& a_value) :
17946 key_(a_key), value_(a_value) {
17947 }
17948
17949 // Gets the user supplied key.
17950 const char* key() const {
17951 return key_.c_str();
17952 }
17953
17954 // Gets the user supplied value.
17955 const char* value() const {
17956 return value_.c_str();
17957 }
17958
17959 // Sets a new value, overriding the one supplied in the constructor.
17960 void SetValue(const std::string& new_value) {
17961 value_ = new_value;
17962 }
17963
17964 private:
17965 // The key supplied by the user.
17966 std::string key_;
17967 // The value supplied by the user.
17968 std::string value_;
17969};
17970
17971// The result of a single Test. This includes a list of
17972// TestPartResults, a list of TestProperties, a count of how many
17973// death tests there are in the Test, and how much time it took to run
17974// the Test.
17975//
17976// TestResult is not copyable.
17977class GTEST_API_ TestResult {
17978 public:
17979 // Creates an empty TestResult.
17980 TestResult();
17981
17982 // D'tor. Do not inherit from TestResult.
17983 ~TestResult();
17984
17985 // Gets the number of all test parts. This is the sum of the number
17986 // of successful test parts and the number of failed test parts.
17987 int total_part_count() const;
17988
17989 // Returns the number of the test properties.
17990 int test_property_count() const;
17991
17992 // Returns true iff the test passed (i.e. no test part failed).
17993 bool Passed() const { return !Failed(); }
17994
17995 // Returns true iff the test failed.
17996 bool Failed() const;
17997
17998 // Returns true iff the test fatally failed.
17999 bool HasFatalFailure() const;
18000
18001 // Returns true iff the test has a non-fatal failure.
18002 bool HasNonfatalFailure() const;
18003
18004 // Returns the elapsed time, in milliseconds.
18005 TimeInMillis elapsed_time() const { return elapsed_time_; }
18006
18007 // Returns the i-th test part result among all the results. i can range
18008 // from 0 to test_property_count() - 1. If i is not in that range, aborts
18009 // the program.
18010 const TestPartResult& GetTestPartResult(int i) const;
18011
18012 // Returns the i-th test property. i can range from 0 to
18013 // test_property_count() - 1. If i is not in that range, aborts the
18014 // program.
18015 const TestProperty& GetTestProperty(int i) const;
18016
18017 private:
18018 friend class TestInfo;
18019 friend class TestCase;
18020 friend class UnitTest;
18021 friend class internal::DefaultGlobalTestPartResultReporter;
18022 friend class internal::ExecDeathTest;
18023 friend class internal::TestResultAccessor;
18024 friend class internal::UnitTestImpl;
18025 friend class internal::WindowsDeathTest;
18026
18027 // Gets the vector of TestPartResults.
18028 const std::vector<TestPartResult>& test_part_results() const {
18029 return test_part_results_;
18030 }
18031
18032 // Gets the vector of TestProperties.
18033 const std::vector<TestProperty>& test_properties() const {
18034 return test_properties_;
18035 }
18036
18037 // Sets the elapsed time.
18038 void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
18039
18040 // Adds a test property to the list. The property is validated and may add
18041 // a non-fatal failure if invalid (e.g., if it conflicts with reserved
18042 // key names). If a property is already recorded for the same key, the
18043 // value will be updated, rather than storing multiple values for the same
18044 // key. xml_element specifies the element for which the property is being
18045 // recorded and is used for validation.
18046 void RecordProperty(const std::string& xml_element,
18047 const TestProperty& test_property);
18048
18049 // Adds a failure if the key is a reserved attribute of Google Test
18050 // testcase tags. Returns true if the property is valid.
18051 // TODO(russr): Validate attribute names are legal and human readable.
18052 static bool ValidateTestProperty(const std::string& xml_element,
18053 const TestProperty& test_property);
18054
18055 // Adds a test part result to the list.
18056 void AddTestPartResult(const TestPartResult& test_part_result);
18057
18058 // Returns the death test count.
18059 int death_test_count() const { return death_test_count_; }
18060
18061 // Increments the death test count, returning the new count.
18062 int increment_death_test_count() { return ++death_test_count_; }
18063
18064 // Clears the test part results.
18065 void ClearTestPartResults();
18066
18067 // Clears the object.
18068 void Clear();
18069
18070 // Protects mutable state of the property vector and of owned
18071 // properties, whose values may be updated.
18072 internal::Mutex test_properites_mutex_;
18073
18074 // The vector of TestPartResults
18075 std::vector<TestPartResult> test_part_results_;
18076 // The vector of TestProperties
18077 std::vector<TestProperty> test_properties_;
18078 // Running count of death tests.
18079 int death_test_count_;
18080 // The elapsed time, in milliseconds.
18081 TimeInMillis elapsed_time_;
18082
18083 // We disallow copying TestResult.
18084 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
18085}; // class TestResult
18086
18087// A TestInfo object stores the following information about a test:
18088//
18089// Test case name
18090// Test name
18091// Whether the test should be run
18092// A function pointer that creates the test object when invoked
18093// Test result
18094//
18095// The constructor of TestInfo registers itself with the UnitTest
18096// singleton such that the RUN_ALL_TESTS() macro knows which tests to
18097// run.
18098class GTEST_API_ TestInfo {
18099 public:
18100 // Destructs a TestInfo object. This function is not virtual, so
18101 // don't inherit from TestInfo.
18102 ~TestInfo();
18103
18104 // Returns the test case name.
18105 const char* test_case_name() const { return test_case_name_.c_str(); }
18106
18107 // Returns the test name.
18108 const char* name() const { return name_.c_str(); }
18109
18110 // Returns the name of the parameter type, or NULL if this is not a typed
18111 // or a type-parameterized test.
18112 const char* type_param() const {
18113 if (type_param_.get() != NULL)
18114 return type_param_->c_str();
18115 return NULL;
18116 }
18117
18118 // Returns the text representation of the value parameter, or NULL if this
18119 // is not a value-parameterized test.
18120 const char* value_param() const {
18121 if (value_param_.get() != NULL)
18122 return value_param_->c_str();
18123 return NULL;
18124 }
18125
18126 // Returns true if this test should run, that is if the test is not
18127 // disabled (or it is disabled but the also_run_disabled_tests flag has
18128 // been specified) and its full name matches the user-specified filter.
18129 //
18130 // Google Test allows the user to filter the tests by their full names.
18131 // The full name of a test Bar in test case Foo is defined as
18132 // "Foo.Bar". Only the tests that match the filter will run.
18133 //
18134 // A filter is a colon-separated list of glob (not regex) patterns,
18135 // optionally followed by a '-' and a colon-separated list of
18136 // negative patterns (tests to exclude). A test is run if it
18137 // matches one of the positive patterns and does not match any of
18138 // the negative patterns.
18139 //
18140 // For example, *A*:Foo.* is a filter that matches any string that
18141 // contains the character 'A' or starts with "Foo.".
18142 bool should_run() const { return should_run_; }
18143
18144 // Returns true iff this test will appear in the XML report.
18145 bool is_reportable() const {
18146 // For now, the XML report includes all tests matching the filter.
18147 // In the future, we may trim tests that are excluded because of
18148 // sharding.
18149 return matches_filter_;
18150 }
18151
18152 // Returns the result of the test.
18153 const TestResult* result() const { return &result_; }
18154
18155 private:
18156#if GTEST_HAS_DEATH_TEST
18157 friend class internal::DefaultDeathTestFactory;
18158#endif // GTEST_HAS_DEATH_TEST
18159 friend class Test;
18160 friend class TestCase;
18161 friend class internal::UnitTestImpl;
18162 friend class internal::StreamingListenerTest;
18163 friend TestInfo* internal::MakeAndRegisterTestInfo(
18164 const char* test_case_name,
18165 const char* name,
18166 const char* type_param,
18167 const char* value_param,
18168 internal::TypeId fixture_class_id,
18169 Test::SetUpTestCaseFunc set_up_tc,
18170 Test::TearDownTestCaseFunc tear_down_tc,
18171 internal::TestFactoryBase* factory);
18172
18173 // Constructs a TestInfo object. The newly constructed instance assumes
18174 // ownership of the factory object.
18175 TestInfo(const std::string& test_case_name,
18176 const std::string& name,
18177 const char* a_type_param, // NULL if not a type-parameterized test
18178 const char* a_value_param, // NULL if not a value-parameterized test
18179 internal::TypeId fixture_class_id,
18180 internal::TestFactoryBase* factory);
18181
18182 // Increments the number of death tests encountered in this test so
18183 // far.
18184 int increment_death_test_count() {
18185 return result_.increment_death_test_count();
18186 }
18187
18188 // Creates the test object, runs it, records its result, and then
18189 // deletes it.
18190 void Run();
18191
18192 static void ClearTestResult(TestInfo* test_info) {
18193 test_info->result_.Clear();
18194 }
18195
18196 // These fields are immutable properties of the test.
18197 const std::string test_case_name_; // Test case name
18198 const std::string name_; // Test name
18199 // Name of the parameter type, or NULL if this is not a typed or a
18200 // type-parameterized test.
18201 const internal::scoped_ptr<const ::std::string> type_param_;
18202 // Text representation of the value parameter, or NULL if this is not a
18203 // value-parameterized test.
18204 const internal::scoped_ptr<const ::std::string> value_param_;
18205 const internal::TypeId fixture_class_id_; // ID of the test fixture class
18206 bool should_run_; // True iff this test should run
18207 bool is_disabled_; // True iff this test is disabled
18208 bool matches_filter_; // True if this test matches the
18209 // user-specified filter.
18210 internal::TestFactoryBase* const factory_; // The factory that creates
18211 // the test object
18212
18213 // This field is mutable and needs to be reset before running the
18214 // test for the second time.
18215 TestResult result_;
18216
18217 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
18218};
18219
18220// A test case, which consists of a vector of TestInfos.
18221//
18222// TestCase is not copyable.
18223class GTEST_API_ TestCase {
18224 public:
18225 // Creates a TestCase with the given name.
18226 //
18227 // TestCase does NOT have a default constructor. Always use this
18228 // constructor to create a TestCase object.
18229 //
18230 // Arguments:
18231 //
18232 // name: name of the test case
18233 // a_type_param: the name of the test's type parameter, or NULL if
18234 // this is not a type-parameterized test.
18235 // set_up_tc: pointer to the function that sets up the test case
18236 // tear_down_tc: pointer to the function that tears down the test case
18237 TestCase(const char* name, const char* a_type_param,
18238 Test::SetUpTestCaseFunc set_up_tc,
18239 Test::TearDownTestCaseFunc tear_down_tc);
18240
18241 // Destructor of TestCase.
18242 virtual ~TestCase();
18243
18244 // Gets the name of the TestCase.
18245 const char* name() const { return name_.c_str(); }
18246
18247 // Returns the name of the parameter type, or NULL if this is not a
18248 // type-parameterized test case.
18249 const char* type_param() const {
18250 if (type_param_.get() != NULL)
18251 return type_param_->c_str();
18252 return NULL;
18253 }
18254
18255 // Returns true if any test in this test case should run.
18256 bool should_run() const { return should_run_; }
18257
18258 // Gets the number of successful tests in this test case.
18259 int successful_test_count() const;
18260
18261 // Gets the number of failed tests in this test case.
18262 int failed_test_count() const;
18263
18264 // Gets the number of disabled tests that will be reported in the XML report.
18265 int reportable_disabled_test_count() const;
18266
18267 // Gets the number of disabled tests in this test case.
18268 int disabled_test_count() const;
18269
18270 // Gets the number of tests to be printed in the XML report.
18271 int reportable_test_count() const;
18272
18273 // Get the number of tests in this test case that should run.
18274 int test_to_run_count() const;
18275
18276 // Gets the number of all tests in this test case.
18277 int total_test_count() const;
18278
18279 // Returns true iff the test case passed.
18280 bool Passed() const { return !Failed(); }
18281
18282 // Returns true iff the test case failed.
18283 bool Failed() const { return failed_test_count() > 0; }
18284
18285 // Returns the elapsed time, in milliseconds.
18286 TimeInMillis elapsed_time() const { return elapsed_time_; }
18287
18288 // Returns the i-th test among all the tests. i can range from 0 to
18289 // total_test_count() - 1. If i is not in that range, returns NULL.
18290 const TestInfo* GetTestInfo(int i) const;
18291
18292 // Returns the TestResult that holds test properties recorded during
18293 // execution of SetUpTestCase and TearDownTestCase.
18294 const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
18295
18296 private:
18297 friend class Test;
18298 friend class internal::UnitTestImpl;
18299
18300 // Gets the (mutable) vector of TestInfos in this TestCase.
18301 std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
18302
18303 // Gets the (immutable) vector of TestInfos in this TestCase.
18304 const std::vector<TestInfo*>& test_info_list() const {
18305 return test_info_list_;
18306 }
18307
18308 // Returns the i-th test among all the tests. i can range from 0 to
18309 // total_test_count() - 1. If i is not in that range, returns NULL.
18310 TestInfo* GetMutableTestInfo(int i);
18311
18312 // Sets the should_run member.
18313 void set_should_run(bool should) { should_run_ = should; }
18314
18315 // Adds a TestInfo to this test case. Will delete the TestInfo upon
18316 // destruction of the TestCase object.
18317 void AddTestInfo(TestInfo * test_info);
18318
18319 // Clears the results of all tests in this test case.
18320 void ClearResult();
18321
18322 // Clears the results of all tests in the given test case.
18323 static void ClearTestCaseResult(TestCase* test_case) {
18324 test_case->ClearResult();
18325 }
18326
18327 // Runs every test in this TestCase.
18328 void Run();
18329
18330 // Runs SetUpTestCase() for this TestCase. This wrapper is needed
18331 // for catching exceptions thrown from SetUpTestCase().
18332 void RunSetUpTestCase() { (*set_up_tc_)(); }
18333
18334 // Runs TearDownTestCase() for this TestCase. This wrapper is
18335 // needed for catching exceptions thrown from TearDownTestCase().
18336 void RunTearDownTestCase() { (*tear_down_tc_)(); }
18337
18338 // Returns true iff test passed.
18339 static bool TestPassed(const TestInfo* test_info) {
18340 return test_info->should_run() && test_info->result()->Passed();
18341 }
18342
18343 // Returns true iff test failed.
18344 static bool TestFailed(const TestInfo* test_info) {
18345 return test_info->should_run() && test_info->result()->Failed();
18346 }
18347
18348 // Returns true iff the test is disabled and will be reported in the XML
18349 // report.
18350 static bool TestReportableDisabled(const TestInfo* test_info) {
18351 return test_info->is_reportable() && test_info->is_disabled_;
18352 }
18353
18354 // Returns true iff test is disabled.
18355 static bool TestDisabled(const TestInfo* test_info) {
18356 return test_info->is_disabled_;
18357 }
18358
18359 // Returns true iff this test will appear in the XML report.
18360 static bool TestReportable(const TestInfo* test_info) {
18361 return test_info->is_reportable();
18362 }
18363
18364 // Returns true if the given test should run.
18365 static bool ShouldRunTest(const TestInfo* test_info) {
18366 return test_info->should_run();
18367 }
18368
18369 // Shuffles the tests in this test case.
18370 void ShuffleTests(internal::Random* random);
18371
18372 // Restores the test order to before the first shuffle.
18373 void UnshuffleTests();
18374
18375 // Name of the test case.
18376 std::string name_;
18377 // Name of the parameter type, or NULL if this is not a typed or a
18378 // type-parameterized test.
18379 const internal::scoped_ptr<const ::std::string> type_param_;
18380 // The vector of TestInfos in their original order. It owns the
18381 // elements in the vector.
18382 std::vector<TestInfo*> test_info_list_;
18383 // Provides a level of indirection for the test list to allow easy
18384 // shuffling and restoring the test order. The i-th element in this
18385 // vector is the index of the i-th test in the shuffled test list.
18386 std::vector<int> test_indices_;
18387 // Pointer to the function that sets up the test case.
18388 Test::SetUpTestCaseFunc set_up_tc_;
18389 // Pointer to the function that tears down the test case.
18390 Test::TearDownTestCaseFunc tear_down_tc_;
18391 // True iff any test in this test case should run.
18392 bool should_run_;
18393 // Elapsed time, in milliseconds.
18394 TimeInMillis elapsed_time_;
18395 // Holds test properties recorded during execution of SetUpTestCase and
18396 // TearDownTestCase.
18397 TestResult ad_hoc_test_result_;
18398
18399 // We disallow copying TestCases.
18400 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
18401};
18402
18403// An Environment object is capable of setting up and tearing down an
18404// environment. The user should subclass this to define his own
18405// environment(s).
18406//
18407// An Environment object does the set-up and tear-down in virtual
18408// methods SetUp() and TearDown() instead of the constructor and the
18409// destructor, as:
18410//
18411// 1. You cannot safely throw from a destructor. This is a problem
18412// as in some cases Google Test is used where exceptions are enabled, and
18413// we may want to implement ASSERT_* using exceptions where they are
18414// available.
18415// 2. You cannot use ASSERT_* directly in a constructor or
18416// destructor.
18417class Environment {
18418 public:
18419 // The d'tor is virtual as we need to subclass Environment.
18420 virtual ~Environment() {}
18421
18422 // Override this to define how to set up the environment.
18423 virtual void SetUp() {}
18424
18425 // Override this to define how to tear down the environment.
18426 virtual void TearDown() {}
18427 private:
18428 // If you see an error about overriding the following function or
18429 // about it being private, you have mis-spelled SetUp() as Setup().
18430 struct Setup_should_be_spelled_SetUp {};
18431 virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
18432};
18433
18434// The interface for tracing execution of tests. The methods are organized in
18435// the order the corresponding events are fired.
18436class TestEventListener {
18437 public:
18438 virtual ~TestEventListener() {}
18439
18440 // Fired before any test activity starts.
18441 virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
18442
18443 // Fired before each iteration of tests starts. There may be more than
18444 // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
18445 // index, starting from 0.
18446 virtual void OnTestIterationStart(const UnitTest& unit_test,
18447 int iteration) = 0;
18448
18449 // Fired before environment set-up for each iteration of tests starts.
18450 virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
18451
18452 // Fired after environment set-up for each iteration of tests ends.
18453 virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
18454
18455 // Fired before the test case starts.
18456 virtual void OnTestCaseStart(const TestCase& test_case) = 0;
18457
18458 // Fired before the test starts.
18459 virtual void OnTestStart(const TestInfo& test_info) = 0;
18460
18461 // Fired after a failed assertion or a SUCCEED() invocation.
18462 virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
18463
18464 // Fired after the test ends.
18465 virtual void OnTestEnd(const TestInfo& test_info) = 0;
18466
18467 // Fired after the test case ends.
18468 virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
18469
18470 // Fired before environment tear-down for each iteration of tests starts.
18471 virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
18472
18473 // Fired after environment tear-down for each iteration of tests ends.
18474 virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
18475
18476 // Fired after each iteration of tests finishes.
18477 virtual void OnTestIterationEnd(const UnitTest& unit_test,
18478 int iteration) = 0;
18479
18480 // Fired after all test activities have ended.
18481 virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
18482};
18483
18484// The convenience class for users who need to override just one or two
18485// methods and are not concerned that a possible change to a signature of
18486// the methods they override will not be caught during the build. For
18487// comments about each method please see the definition of TestEventListener
18488// above.
18489class EmptyTestEventListener : public TestEventListener {
18490 public:
18491 virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
18492 virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
18493 int /*iteration*/) {}
18494 virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
18495 virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
18496 virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
18497 virtual void OnTestStart(const TestInfo& /*test_info*/) {}
18498 virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
18499 virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
18500 virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
18501 virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
18502 virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
18503 virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
18504 int /*iteration*/) {}
18505 virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
18506};
18507
18508// TestEventListeners lets users add listeners to track events in Google Test.
18509class GTEST_API_ TestEventListeners {
18510 public:
18511 TestEventListeners();
18512 ~TestEventListeners();
18513
18514 // Appends an event listener to the end of the list. Google Test assumes
18515 // the ownership of the listener (i.e. it will delete the listener when
18516 // the test program finishes).
18517 void Append(TestEventListener* listener);
18518
18519 // Removes the given event listener from the list and returns it. It then
18520 // becomes the caller's responsibility to delete the listener. Returns
18521 // NULL if the listener is not found in the list.
18522 TestEventListener* Release(TestEventListener* listener);
18523
18524 // Returns the standard listener responsible for the default console
18525 // output. Can be removed from the listeners list to shut down default
18526 // console output. Note that removing this object from the listener list
18527 // with Release transfers its ownership to the caller and makes this
18528 // function return NULL the next time.
18529 TestEventListener* default_result_printer() const {
18530 return default_result_printer_;
18531 }
18532
18533 // Returns the standard listener responsible for the default XML output
18534 // controlled by the --gtest_output=xml flag. Can be removed from the
18535 // listeners list by users who want to shut down the default XML output
18536 // controlled by this flag and substitute it with custom one. Note that
18537 // removing this object from the listener list with Release transfers its
18538 // ownership to the caller and makes this function return NULL the next
18539 // time.
18540 TestEventListener* default_xml_generator() const {
18541 return default_xml_generator_;
18542 }
18543
18544 private:
18545 friend class TestCase;
18546 friend class TestInfo;
18547 friend class internal::DefaultGlobalTestPartResultReporter;
18548 friend class internal::NoExecDeathTest;
18549 friend class internal::TestEventListenersAccessor;
18550 friend class internal::UnitTestImpl;
18551
18552 // Returns repeater that broadcasts the TestEventListener events to all
18553 // subscribers.
18554 TestEventListener* repeater();
18555
18556 // Sets the default_result_printer attribute to the provided listener.
18557 // The listener is also added to the listener list and previous
18558 // default_result_printer is removed from it and deleted. The listener can
18559 // also be NULL in which case it will not be added to the list. Does
18560 // nothing if the previous and the current listener objects are the same.
18561 void SetDefaultResultPrinter(TestEventListener* listener);
18562
18563 // Sets the default_xml_generator attribute to the provided listener. The
18564 // listener is also added to the listener list and previous
18565 // default_xml_generator is removed from it and deleted. The listener can
18566 // also be NULL in which case it will not be added to the list. Does
18567 // nothing if the previous and the current listener objects are the same.
18568 void SetDefaultXmlGenerator(TestEventListener* listener);
18569
18570 // Controls whether events will be forwarded by the repeater to the
18571 // listeners in the list.
18572 bool EventForwardingEnabled() const;
18573 void SuppressEventForwarding();
18574
18575 // The actual list of listeners.
18576 internal::TestEventRepeater* repeater_;
18577 // Listener responsible for the standard result output.
18578 TestEventListener* default_result_printer_;
18579 // Listener responsible for the creation of the XML output file.
18580 TestEventListener* default_xml_generator_;
18581
18582 // We disallow copying TestEventListeners.
18583 GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
18584};
18585
18586// A UnitTest consists of a vector of TestCases.
18587//
18588// This is a singleton class. The only instance of UnitTest is
18589// created when UnitTest::GetInstance() is first called. This
18590// instance is never deleted.
18591//
18592// UnitTest is not copyable.
18593//
18594// This class is thread-safe as long as the methods are called
18595// according to their specification.
18596class GTEST_API_ UnitTest {
18597 public:
18598 // Gets the singleton UnitTest object. The first time this method
18599 // is called, a UnitTest object is constructed and returned.
18600 // Consecutive calls will return the same object.
18601 static UnitTest* GetInstance();
18602
18603 // Runs all tests in this UnitTest object and prints the result.
18604 // Returns 0 if successful, or 1 otherwise.
18605 //
18606 // This method can only be called from the main thread.
18607 //
18608 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18609 int Run() GTEST_MUST_USE_RESULT_;
18610
18611 // Returns the working directory when the first TEST() or TEST_F()
18612 // was executed. The UnitTest object owns the string.
18613 const char* original_working_dir() const;
18614
18615 // Returns the TestCase object for the test that's currently running,
18616 // or NULL if no test is running.
18617 const TestCase* current_test_case() const
18618 GTEST_LOCK_EXCLUDED_(mutex_);
18619
18620 // Returns the TestInfo object for the test that's currently running,
18621 // or NULL if no test is running.
18622 const TestInfo* current_test_info() const
18623 GTEST_LOCK_EXCLUDED_(mutex_);
18624
18625 // Returns the random seed used at the start of the current test run.
18626 int random_seed() const;
18627
18628#if GTEST_HAS_PARAM_TEST
18629 // Returns the ParameterizedTestCaseRegistry object used to keep track of
18630 // value-parameterized tests and instantiate and register them.
18631 //
18632 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18633 internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
18634 GTEST_LOCK_EXCLUDED_(mutex_);
18635#endif // GTEST_HAS_PARAM_TEST
18636
18637 // Gets the number of successful test cases.
18638 int successful_test_case_count() const;
18639
18640 // Gets the number of failed test cases.
18641 int failed_test_case_count() const;
18642
18643 // Gets the number of all test cases.
18644 int total_test_case_count() const;
18645
18646 // Gets the number of all test cases that contain at least one test
18647 // that should run.
18648 int test_case_to_run_count() const;
18649
18650 // Gets the number of successful tests.
18651 int successful_test_count() const;
18652
18653 // Gets the number of failed tests.
18654 int failed_test_count() const;
18655
18656 // Gets the number of disabled tests that will be reported in the XML report.
18657 int reportable_disabled_test_count() const;
18658
18659 // Gets the number of disabled tests.
18660 int disabled_test_count() const;
18661
18662 // Gets the number of tests to be printed in the XML report.
18663 int reportable_test_count() const;
18664
18665 // Gets the number of all tests.
18666 int total_test_count() const;
18667
18668 // Gets the number of tests that should run.
18669 int test_to_run_count() const;
18670
18671 // Gets the time of the test program start, in ms from the start of the
18672 // UNIX epoch.
18673 TimeInMillis start_timestamp() const;
18674
18675 // Gets the elapsed time, in milliseconds.
18676 TimeInMillis elapsed_time() const;
18677
18678 // Returns true iff the unit test passed (i.e. all test cases passed).
18679 bool Passed() const;
18680
18681 // Returns true iff the unit test failed (i.e. some test case failed
18682 // or something outside of all tests failed).
18683 bool Failed() const;
18684
18685 // Gets the i-th test case among all the test cases. i can range from 0 to
18686 // total_test_case_count() - 1. If i is not in that range, returns NULL.
18687 const TestCase* GetTestCase(int i) const;
18688
18689 // Returns the TestResult containing information on test failures and
18690 // properties logged outside of individual test cases.
18691 const TestResult& ad_hoc_test_result() const;
18692
18693 // Returns the list of event listeners that can be used to track events
18694 // inside Google Test.
18695 TestEventListeners& listeners();
18696
18697 private:
18698 // Registers and returns a global test environment. When a test
18699 // program is run, all global test environments will be set-up in
18700 // the order they were registered. After all tests in the program
18701 // have finished, all global test environments will be torn-down in
18702 // the *reverse* order they were registered.
18703 //
18704 // The UnitTest object takes ownership of the given environment.
18705 //
18706 // This method can only be called from the main thread.
18707 Environment* AddEnvironment(Environment* env);
18708
18709 // Adds a TestPartResult to the current TestResult object. All
18710 // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
18711 // eventually call this to report their results. The user code
18712 // should use the assertion macros instead of calling this directly.
18713 void AddTestPartResult(TestPartResult::Type result_type,
18714 const char* file_name,
18715 int line_number,
18716 const std::string& message,
18717 const std::string& os_stack_trace)
18718 GTEST_LOCK_EXCLUDED_(mutex_);
18719
18720 // Adds a TestProperty to the current TestResult object when invoked from
18721 // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
18722 // from SetUpTestCase or TearDownTestCase, or to the global property set
18723 // when invoked elsewhere. If the result already contains a property with
18724 // the same key, the value will be updated.
18725 void RecordProperty(const std::string& key, const std::string& value);
18726
18727 // Gets the i-th test case among all the test cases. i can range from 0 to
18728 // total_test_case_count() - 1. If i is not in that range, returns NULL.
18729 TestCase* GetMutableTestCase(int i);
18730
18731 // Accessors for the implementation object.
18732 internal::UnitTestImpl* impl() { return impl_; }
18733 const internal::UnitTestImpl* impl() const { return impl_; }
18734
18735 // These classes and funcions are friends as they need to access private
18736 // members of UnitTest.
18737 friend class Test;
18738 friend class internal::AssertHelper;
18739 friend class internal::ScopedTrace;
18740 friend class internal::StreamingListenerTest;
18741 friend class internal::UnitTestRecordPropertyTestHelper;
18742 friend Environment* AddGlobalTestEnvironment(Environment* env);
18743 friend internal::UnitTestImpl* internal::GetUnitTestImpl();
18744 friend void internal::ReportFailureInUnknownLocation(
18745 TestPartResult::Type result_type,
18746 const std::string& message);
18747
18748 // Creates an empty UnitTest.
18749 UnitTest();
18750
18751 // D'tor
18752 virtual ~UnitTest();
18753
18754 // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
18755 // Google Test trace stack.
18756 void PushGTestTrace(const internal::TraceInfo& trace)
18757 GTEST_LOCK_EXCLUDED_(mutex_);
18758
18759 // Pops a trace from the per-thread Google Test trace stack.
18760 void PopGTestTrace()
18761 GTEST_LOCK_EXCLUDED_(mutex_);
18762
18763 // Protects mutable state in *impl_. This is mutable as some const
18764 // methods need to lock it too.
18765 mutable internal::Mutex mutex_;
18766
18767 // Opaque implementation object. This field is never changed once
18768 // the object is constructed. We don't mark it as const here, as
18769 // doing so will cause a warning in the constructor of UnitTest.
18770 // Mutable state in *impl_ is protected by mutex_.
18771 internal::UnitTestImpl* impl_;
18772
18773 // We disallow copying UnitTest.
18774 GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
18775};
18776
18777// A convenient wrapper for adding an environment for the test
18778// program.
18779//
18780// You should call this before RUN_ALL_TESTS() is called, probably in
18781// main(). If you use gtest_main, you need to call this before main()
18782// starts for it to take effect. For example, you can define a global
18783// variable like this:
18784//
18785// testing::Environment* const foo_env =
18786// testing::AddGlobalTestEnvironment(new FooEnvironment);
18787//
18788// However, we strongly recommend you to write your own main() and
18789// call AddGlobalTestEnvironment() there, as relying on initialization
18790// of global variables makes the code harder to read and may cause
18791// problems when you register multiple environments from different
18792// translation units and the environments have dependencies among them
18793// (remember that the compiler doesn't guarantee the order in which
18794// global variables from different translation units are initialized).
18795inline Environment* AddGlobalTestEnvironment(Environment* env) {
18796 return UnitTest::GetInstance()->AddEnvironment(env);
18797}
18798
18799// Initializes Google Test. This must be called before calling
18800// RUN_ALL_TESTS(). In particular, it parses a command line for the
18801// flags that Google Test recognizes. Whenever a Google Test flag is
18802// seen, it is removed from argv, and *argc is decremented.
18803//
18804// No value is returned. Instead, the Google Test flag variables are
18805// updated.
18806//
18807// Calling the function for the second time has no user-visible effect.
18808GTEST_API_ void InitGoogleTest(int* argc, char** argv);
18809
18810// This overloaded version can be used in Windows programs compiled in
18811// UNICODE mode.
18812GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
18813
18814namespace internal {
18815
18816// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
18817// value of type ToPrint that is an operand of a comparison assertion
18818// (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in
18819// the comparison, and is used to help determine the best way to
18820// format the value. In particular, when the value is a C string
18821// (char pointer) and the other operand is an STL string object, we
18822// want to format the C string as a string, since we know it is
18823// compared by value with the string object. If the value is a char
18824// pointer but the other operand is not an STL string object, we don't
18825// know whether the pointer is supposed to point to a NUL-terminated
18826// string, and thus want to print it as a pointer to be safe.
18827//
18828// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18829
18830// The default case.
18831template <typename ToPrint, typename OtherOperand>
18832class FormatForComparison {
18833 public:
18834 static ::std::string Format(const ToPrint& value) {
18835 return ::testing::PrintToString(value);
18836 }
18837};
18838
18839// Array.
18840template <typename ToPrint, size_t N, typename OtherOperand>
18841class FormatForComparison<ToPrint[N], OtherOperand> {
18842 public:
18843 static ::std::string Format(const ToPrint* value) {
18844 return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
18845 }
18846};
18847
18848// By default, print C string as pointers to be safe, as we don't know
18849// whether they actually point to a NUL-terminated string.
18850
18851#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
18852 template <typename OtherOperand> \
18853 class FormatForComparison<CharType*, OtherOperand> { \
18854 public: \
18855 static ::std::string Format(CharType* value) { \
18856 return ::testing::PrintToString(static_cast<const void*>(value)); \
18857 } \
18858 }
18859
18860GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
18861GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
18862GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
18863GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
18864
18865#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
18866
18867// If a C string is compared with an STL string object, we know it's meant
18868// to point to a NUL-terminated string, and thus can print it as a string.
18869
18870#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
18871 template <> \
18872 class FormatForComparison<CharType*, OtherStringType> { \
18873 public: \
18874 static ::std::string Format(CharType* value) { \
18875 return ::testing::PrintToString(value); \
18876 } \
18877 }
18878
18879GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
18880GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
18881
18882#if GTEST_HAS_GLOBAL_STRING
18883GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
18884GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
18885#endif
18886
18887#if GTEST_HAS_GLOBAL_WSTRING
18888GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
18889GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
18890#endif
18891
18892#if GTEST_HAS_STD_WSTRING
18893GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
18894GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
18895#endif
18896
18897#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
18898
18899// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
18900// operand to be used in a failure message. The type (but not value)
18901// of the other operand may affect the format. This allows us to
18902// print a char* as a raw pointer when it is compared against another
18903// char* or void*, and print it as a C string when it is compared
18904// against an std::string object, for example.
18905//
18906// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18907template <typename T1, typename T2>
18908std::string FormatForComparisonFailureMessage(
18909 const T1& value, const T2& /* other_operand */) {
18910 return FormatForComparison<T1, T2>::Format(value);
18911}
18912
18913// The helper function for {ASSERT|EXPECT}_EQ.
18914template <typename T1, typename T2>
18915AssertionResult CmpHelperEQ(const char* expected_expression,
18916 const char* actual_expression,
18917 const T1& expected,
18918 const T2& actual) {
18919#ifdef _MSC_VER
18920# pragma warning(push) // Saves the current warning state.
18921# pragma warning(disable:4389) // Temporarily disables warning on
18922 // signed/unsigned mismatch.
18923#endif
18924
18925 if (expected == actual) {
18926 return AssertionSuccess();
18927 }
18928
18929#ifdef _MSC_VER
18930# pragma warning(pop) // Restores the warning state.
18931#endif
18932
18933 return EqFailure(expected_expression,
18934 actual_expression,
18935 FormatForComparisonFailureMessage(expected, actual),
18936 FormatForComparisonFailureMessage(actual, expected),
18937 false);
18938}
18939
18940// With this overloaded version, we allow anonymous enums to be used
18941// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
18942// can be implicitly cast to BiggestInt.
18943GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
18944 const char* actual_expression,
18945 BiggestInt expected,
18946 BiggestInt actual);
18947
18948// The helper class for {ASSERT|EXPECT}_EQ. The template argument
18949// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
18950// is a null pointer literal. The following default implementation is
18951// for lhs_is_null_literal being false.
18952template <bool lhs_is_null_literal>
18953class EqHelper {
18954 public:
18955 // This templatized version is for the general case.
18956 template <typename T1, typename T2>
18957 static AssertionResult Compare(const char* expected_expression,
18958 const char* actual_expression,
18959 const T1& expected,
18960 const T2& actual) {
18961 return CmpHelperEQ(expected_expression, actual_expression, expected,
18962 actual);
18963 }
18964
18965 // With this overloaded version, we allow anonymous enums to be used
18966 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
18967 // enums can be implicitly cast to BiggestInt.
18968 //
18969 // Even though its body looks the same as the above version, we
18970 // cannot merge the two, as it will make anonymous enums unhappy.
18971 static AssertionResult Compare(const char* expected_expression,
18972 const char* actual_expression,
18973 BiggestInt expected,
18974 BiggestInt actual) {
18975 return CmpHelperEQ(expected_expression, actual_expression, expected,
18976 actual);
18977 }
18978};
18979
18980// This specialization is used when the first argument to ASSERT_EQ()
18981// is a null pointer literal, like NULL, false, or 0.
18982template <>
18983class EqHelper<true> {
18984 public:
18985 // We define two overloaded versions of Compare(). The first
18986 // version will be picked when the second argument to ASSERT_EQ() is
18987 // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
18988 // EXPECT_EQ(false, a_bool).
18989 template <typename T1, typename T2>
18990 static AssertionResult Compare(
18991 const char* expected_expression,
18992 const char* actual_expression,
18993 const T1& expected,
18994 const T2& actual,
18995 // The following line prevents this overload from being considered if T2
18996 // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
18997 // expands to Compare("", "", NULL, my_ptr), which requires a conversion
18998 // to match the Secret* in the other overload, which would otherwise make
18999 // this template match better.
19000 typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
19001 return CmpHelperEQ(expected_expression, actual_expression, expected,
19002 actual);
19003 }
19004
19005 // This version will be picked when the second argument to ASSERT_EQ() is a
19006 // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
19007 template <typename T>
19008 static AssertionResult Compare(
19009 const char* expected_expression,
19010 const char* actual_expression,
19011 // We used to have a second template parameter instead of Secret*. That
19012 // template parameter would deduce to 'long', making this a better match
19013 // than the first overload even without the first overload's EnableIf.
19014 // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
19015 // non-pointer argument" (even a deduced integral argument), so the old
19016 // implementation caused warnings in user code.
19017 Secret* /* expected (NULL) */,
19018 T* actual) {
19019 // We already know that 'expected' is a null pointer.
19020 return CmpHelperEQ(expected_expression, actual_expression,
19021 static_cast<T*>(NULL), actual);
19022 }
19023};
19024
19025// A macro for implementing the helper functions needed to implement
19026// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
19027// of similar code.
19028//
19029// For each templatized helper function, we also define an overloaded
19030// version for BiggestInt in order to reduce code bloat and allow
19031// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
19032// with gcc 4.
19033//
19034// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19035#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
19036template <typename T1, typename T2>\
19037AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
19038 const T1& val1, const T2& val2) {\
19039 if (val1 op val2) {\
19040 return AssertionSuccess();\
19041 } else {\
19042 return AssertionFailure() \
19043 << "Expected: (" << expr1 << ") " #op " (" << expr2\
19044 << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
19045 << " vs " << FormatForComparisonFailureMessage(val2, val1);\
19046 }\
19047}\
19048GTEST_API_ AssertionResult CmpHelper##op_name(\
19049 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
19050
19051// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19052
19053// Implements the helper function for {ASSERT|EXPECT}_NE
19054GTEST_IMPL_CMP_HELPER_(NE, !=);
19055// Implements the helper function for {ASSERT|EXPECT}_LE
19056GTEST_IMPL_CMP_HELPER_(LE, <=);
19057// Implements the helper function for {ASSERT|EXPECT}_LT
19058GTEST_IMPL_CMP_HELPER_(LT, <);
19059// Implements the helper function for {ASSERT|EXPECT}_GE
19060GTEST_IMPL_CMP_HELPER_(GE, >=);
19061// Implements the helper function for {ASSERT|EXPECT}_GT
19062GTEST_IMPL_CMP_HELPER_(GT, >);
19063
19064#undef GTEST_IMPL_CMP_HELPER_
19065
19066// The helper function for {ASSERT|EXPECT}_STREQ.
19067//
19068// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19069GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19070 const char* actual_expression,
19071 const char* expected,
19072 const char* actual);
19073
19074// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
19075//
19076// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19077GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
19078 const char* actual_expression,
19079 const char* expected,
19080 const char* actual);
19081
19082// The helper function for {ASSERT|EXPECT}_STRNE.
19083//
19084// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19085GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19086 const char* s2_expression,
19087 const char* s1,
19088 const char* s2);
19089
19090// The helper function for {ASSERT|EXPECT}_STRCASENE.
19091//
19092// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19093GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
19094 const char* s2_expression,
19095 const char* s1,
19096 const char* s2);
19097
19098
19099// Helper function for *_STREQ on wide strings.
19100//
19101// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19102GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19103 const char* actual_expression,
19104 const wchar_t* expected,
19105 const wchar_t* actual);
19106
19107// Helper function for *_STRNE on wide strings.
19108//
19109// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19110GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19111 const char* s2_expression,
19112 const wchar_t* s1,
19113 const wchar_t* s2);
19114
19115} // namespace internal
19116
19117// IsSubstring() and IsNotSubstring() are intended to be used as the
19118// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
19119// themselves. They check whether needle is a substring of haystack
19120// (NULL is considered a substring of itself only), and return an
19121// appropriate error message when they fail.
19122//
19123// The {needle,haystack}_expr arguments are the stringified
19124// expressions that generated the two real arguments.
19125GTEST_API_ AssertionResult IsSubstring(
19126 const char* needle_expr, const char* haystack_expr,
19127 const char* needle, const char* haystack);
19128GTEST_API_ AssertionResult IsSubstring(
19129 const char* needle_expr, const char* haystack_expr,
19130 const wchar_t* needle, const wchar_t* haystack);
19131GTEST_API_ AssertionResult IsNotSubstring(
19132 const char* needle_expr, const char* haystack_expr,
19133 const char* needle, const char* haystack);
19134GTEST_API_ AssertionResult IsNotSubstring(
19135 const char* needle_expr, const char* haystack_expr,
19136 const wchar_t* needle, const wchar_t* haystack);
19137GTEST_API_ AssertionResult IsSubstring(
19138 const char* needle_expr, const char* haystack_expr,
19139 const ::std::string& needle, const ::std::string& haystack);
19140GTEST_API_ AssertionResult IsNotSubstring(
19141 const char* needle_expr, const char* haystack_expr,
19142 const ::std::string& needle, const ::std::string& haystack);
19143
19144#if GTEST_HAS_STD_WSTRING
19145GTEST_API_ AssertionResult IsSubstring(
19146 const char* needle_expr, const char* haystack_expr,
19147 const ::std::wstring& needle, const ::std::wstring& haystack);
19148GTEST_API_ AssertionResult IsNotSubstring(
19149 const char* needle_expr, const char* haystack_expr,
19150 const ::std::wstring& needle, const ::std::wstring& haystack);
19151#endif // GTEST_HAS_STD_WSTRING
19152
19153namespace internal {
19154
19155// Helper template function for comparing floating-points.
19156//
19157// Template parameter:
19158//
19159// RawType: the raw floating-point type (either float or double)
19160//
19161// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19162template <typename RawType>
19163AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
19164 const char* actual_expression,
19165 RawType expected,
19166 RawType actual) {
19167 const FloatingPoint<RawType> lhs(expected), rhs(actual);
19168
19169 if (lhs.AlmostEquals(rhs)) {
19170 return AssertionSuccess();
19171 }
19172
19173 ::std::stringstream expected_ss;
19174 expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19175 << expected;
19176
19177 ::std::stringstream actual_ss;
19178 actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19179 << actual;
19180
19181 return EqFailure(expected_expression,
19182 actual_expression,
19183 StringStreamToString(&expected_ss),
19184 StringStreamToString(&actual_ss),
19185 false);
19186}
19187
19188// Helper function for implementing ASSERT_NEAR.
19189//
19190// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19191GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
19192 const char* expr2,
19193 const char* abs_error_expr,
19194 double val1,
19195 double val2,
19196 double abs_error);
19197
19198// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19199// A class that enables one to stream messages to assertion macros
19200class GTEST_API_ AssertHelper {
19201 public:
19202 // Constructor.
19203 AssertHelper(TestPartResult::Type type,
19204 const char* file,
19205 int line,
19206 const char* message);
19207 ~AssertHelper();
19208
19209 // Message assignment is a semantic trick to enable assertion
19210 // streaming; see the GTEST_MESSAGE_ macro below.
19211 void operator=(const Message& message) const;
19212
19213 private:
19214 // We put our data in a struct so that the size of the AssertHelper class can
19215 // be as small as possible. This is important because gcc is incapable of
19216 // re-using stack space even for temporary variables, so every EXPECT_EQ
19217 // reserves stack space for another AssertHelper.
19218 struct AssertHelperData {
19219 AssertHelperData(TestPartResult::Type t,
19220 const char* srcfile,
19221 int line_num,
19222 const char* msg)
19223 : type(t), file(srcfile), line(line_num), message(msg) { }
19224
19225 TestPartResult::Type const type;
19226 const char* const file;
19227 int const line;
19228 std::string const message;
19229
19230 private:
19231 GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
19232 };
19233
19234 AssertHelperData* const data_;
19235
19236 GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
19237};
19238
19239} // namespace internal
19240
19241#if GTEST_HAS_PARAM_TEST
19242// The pure interface class that all value-parameterized tests inherit from.
19243// A value-parameterized class must inherit from both ::testing::Test and
19244// ::testing::WithParamInterface. In most cases that just means inheriting
19245// from ::testing::TestWithParam, but more complicated test hierarchies
19246// may need to inherit from Test and WithParamInterface at different levels.
19247//
19248// This interface has support for accessing the test parameter value via
19249// the GetParam() method.
19250//
19251// Use it with one of the parameter generator defining functions, like Range(),
19252// Values(), ValuesIn(), Bool(), and Combine().
19253//
19254// class FooTest : public ::testing::TestWithParam<int> {
19255// protected:
19256// FooTest() {
19257// // Can use GetParam() here.
19258// }
19259// virtual ~FooTest() {
19260// // Can use GetParam() here.
19261// }
19262// virtual void SetUp() {
19263// // Can use GetParam() here.
19264// }
19265// virtual void TearDown {
19266// // Can use GetParam() here.
19267// }
19268// };
19269// TEST_P(FooTest, DoesBar) {
19270// // Can use GetParam() method here.
19271// Foo foo;
19272// ASSERT_TRUE(foo.DoesBar(GetParam()));
19273// }
19274// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
19275
19276template <typename T>
19277class WithParamInterface {
19278 public:
19279 typedef T ParamType;
19280 virtual ~WithParamInterface() {}
19281
19282 // The current parameter value. Is also available in the test fixture's
19283 // constructor. This member function is non-static, even though it only
19284 // references static data, to reduce the opportunity for incorrect uses
19285 // like writing 'WithParamInterface<bool>::GetParam()' for a test that
19286 // uses a fixture whose parameter type is int.
19287 const ParamType& GetParam() const {
19288 GTEST_CHECK_(parameter_ != NULL)
19289 << "GetParam() can only be called inside a value-parameterized test "
19290 << "-- did you intend to write TEST_P instead of TEST_F?";
19291 return *parameter_;
19292 }
19293
19294 private:
19295 // Sets parameter value. The caller is responsible for making sure the value
19296 // remains alive and unchanged throughout the current test.
19297 static void SetParam(const ParamType* parameter) {
19298 parameter_ = parameter;
19299 }
19300
19301 // Static value used for accessing parameter during a test lifetime.
19302 static const ParamType* parameter_;
19303
19304 // TestClass must be a subclass of WithParamInterface<T> and Test.
19305 template <class TestClass> friend class internal::ParameterizedTestFactory;
19306};
19307
19308template <typename T>
19309const T* WithParamInterface<T>::parameter_ = NULL;
19310
19311// Most value-parameterized classes can ignore the existence of
19312// WithParamInterface, and can just inherit from ::testing::TestWithParam.
19313
19314template <typename T>
19315class TestWithParam : public Test, public WithParamInterface<T> {
19316};
19317
19318#endif // GTEST_HAS_PARAM_TEST
19319
19320// Macros for indicating success/failure in test code.
19321
19322// ADD_FAILURE unconditionally adds a failure to the current test.
19323// SUCCEED generates a success - it doesn't automatically make the
19324// current test successful, as a test is only successful when it has
19325// no failure.
19326//
19327// EXPECT_* verifies that a certain condition is satisfied. If not,
19328// it behaves like ADD_FAILURE. In particular:
19329//
19330// EXPECT_TRUE verifies that a Boolean condition is true.
19331// EXPECT_FALSE verifies that a Boolean condition is false.
19332//
19333// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
19334// that they will also abort the current function on failure. People
19335// usually want the fail-fast behavior of FAIL and ASSERT_*, but those
19336// writing data-driven tests often find themselves using ADD_FAILURE
19337// and EXPECT_* more.
19338
19339// Generates a nonfatal failure with a generic message.
19340#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
19341
19342// Generates a nonfatal failure at the given source file location with
19343// a generic message.
19344#define ADD_FAILURE_AT(file, line) \
19345 GTEST_MESSAGE_AT_(file, line, "Failed", \
19346 ::testing::TestPartResult::kNonFatalFailure)
19347
19348// Generates a fatal failure with a generic message.
19349#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
19350
19351// Define this macro to 1 to omit the definition of FAIL(), which is a
19352// generic name and clashes with some other libraries.
19353#if !GTEST_DONT_DEFINE_FAIL
19354# define FAIL() GTEST_FAIL()
19355#endif
19356
19357// Generates a success with a generic message.
19358#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
19359
19360// Define this macro to 1 to omit the definition of SUCCEED(), which
19361// is a generic name and clashes with some other libraries.
19362#if !GTEST_DONT_DEFINE_SUCCEED
19363# define SUCCEED() GTEST_SUCCEED()
19364#endif
19365
19366// Macros for testing exceptions.
19367//
19368// * {ASSERT|EXPECT}_THROW(statement, expected_exception):
19369// Tests that the statement throws the expected exception.
19370// * {ASSERT|EXPECT}_NO_THROW(statement):
19371// Tests that the statement doesn't throw any exception.
19372// * {ASSERT|EXPECT}_ANY_THROW(statement):
19373// Tests that the statement throws an exception.
19374
19375#define EXPECT_THROW(statement, expected_exception) \
19376 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
19377#define EXPECT_NO_THROW(statement) \
19378 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19379#define EXPECT_ANY_THROW(statement) \
19380 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19381#define ASSERT_THROW(statement, expected_exception) \
19382 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
19383#define ASSERT_NO_THROW(statement) \
19384 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
19385#define ASSERT_ANY_THROW(statement) \
19386 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
19387
19388// Boolean assertions. Condition can be either a Boolean expression or an
19389// AssertionResult. For more information on how to use AssertionResult with
19390// these macros see comments on that class.
19391#define EXPECT_TRUE(condition) \
19392 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19393 GTEST_NONFATAL_FAILURE_)
19394#define EXPECT_FALSE(condition) \
19395 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19396 GTEST_NONFATAL_FAILURE_)
19397#define ASSERT_TRUE(condition) \
19398 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19399 GTEST_FATAL_FAILURE_)
19400#define ASSERT_FALSE(condition) \
19401 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19402 GTEST_FATAL_FAILURE_)
19403
19404// Includes the auto-generated header that implements a family of
19405// generic predicate assertion macros.
19406// Copyright 2006, Google Inc.
19407// All rights reserved.
19408//
19409// Redistribution and use in source and binary forms, with or without
19410// modification, are permitted provided that the following conditions are
19411// met:
19412//
19413// * Redistributions of source code must retain the above copyright
19414// notice, this list of conditions and the following disclaimer.
19415// * Redistributions in binary form must reproduce the above
19416// copyright notice, this list of conditions and the following disclaimer
19417// in the documentation and/or other materials provided with the
19418// distribution.
19419// * Neither the name of Google Inc. nor the names of its
19420// contributors may be used to endorse or promote products derived from
19421// this software without specific prior written permission.
19422//
19423// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19424// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19425// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19426// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19427// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19428// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19429// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19430// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19431// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19432// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19433// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19434
19435// This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
19436// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
19437//
19438// Implements a family of generic predicate assertion macros.
19439
19440#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19441#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19442
19443// Makes sure this header is not included before gtest.h.
19444#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
19445# error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
19446#endif // GTEST_INCLUDE_GTEST_GTEST_H_
19447
19448// This header implements a family of generic predicate assertion
19449// macros:
19450//
19451// ASSERT_PRED_FORMAT1(pred_format, v1)
19452// ASSERT_PRED_FORMAT2(pred_format, v1, v2)
19453// ...
19454//
19455// where pred_format is a function or functor that takes n (in the
19456// case of ASSERT_PRED_FORMATn) values and their source expression
19457// text, and returns a testing::AssertionResult. See the definition
19458// of ASSERT_EQ in gtest.h for an example.
19459//
19460// If you don't care about formatting, you can use the more
19461// restrictive version:
19462//
19463// ASSERT_PRED1(pred, v1)
19464// ASSERT_PRED2(pred, v1, v2)
19465// ...
19466//
19467// where pred is an n-ary function or functor that returns bool,
19468// and the values v1, v2, ..., must support the << operator for
19469// streaming to std::ostream.
19470//
19471// We also define the EXPECT_* variations.
19472//
19473// For now we only support predicates whose arity is at most 5.
19474// Please email googletestframework@googlegroups.com if you need
19475// support for higher arities.
19476
19477// GTEST_ASSERT_ is the basic statement to which all of the assertions
19478// in this file reduce. Don't use this in your code.
19479
19480#define GTEST_ASSERT_(expression, on_failure) \
19481 GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
19482 if (const ::testing::AssertionResult gtest_ar = (expression)) \
19483 ; \
19484 else \
19485 on_failure(gtest_ar.failure_message())
19486
19487
19488// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
19489// this in your code.
19490template <typename Pred,
19491 typename T1>
19492AssertionResult AssertPred1Helper(const char* pred_text,
19493 const char* e1,
19494 Pred pred,
19495 const T1& v1) {
19496 if (pred(v1)) return AssertionSuccess();
19497
19498 return AssertionFailure() << pred_text << "("
19499 << e1 << ") evaluates to false, where"
19500 << "\n" << e1 << " evaluates to " << v1;
19501}
19502
19503// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
19504// Don't use this in your code.
19505#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
19506 GTEST_ASSERT_(pred_format(#v1, v1), \
19507 on_failure)
19508
19509// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
19510// this in your code.
19511#define GTEST_PRED1_(pred, v1, on_failure)\
19512 GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
19513 #v1, \
19514 pred, \
19515 v1), on_failure)
19516
19517// Unary predicate assertion macros.
19518#define EXPECT_PRED_FORMAT1(pred_format, v1) \
19519 GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
19520#define EXPECT_PRED1(pred, v1) \
19521 GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
19522#define ASSERT_PRED_FORMAT1(pred_format, v1) \
19523 GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
19524#define ASSERT_PRED1(pred, v1) \
19525 GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
19526
19527
19528
19529// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
19530// this in your code.
19531template <typename Pred,
19532 typename T1,
19533 typename T2>
19534AssertionResult AssertPred2Helper(const char* pred_text,
19535 const char* e1,
19536 const char* e2,
19537 Pred pred,
19538 const T1& v1,
19539 const T2& v2) {
19540 if (pred(v1, v2)) return AssertionSuccess();
19541
19542 return AssertionFailure() << pred_text << "("
19543 << e1 << ", "
19544 << e2 << ") evaluates to false, where"
19545 << "\n" << e1 << " evaluates to " << v1
19546 << "\n" << e2 << " evaluates to " << v2;
19547}
19548
19549// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
19550// Don't use this in your code.
19551#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
19552 GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
19553 on_failure)
19554
19555// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
19556// this in your code.
19557#define GTEST_PRED2_(pred, v1, v2, on_failure)\
19558 GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
19559 #v1, \
19560 #v2, \
19561 pred, \
19562 v1, \
19563 v2), on_failure)
19564
19565// Binary predicate assertion macros.
19566#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
19567 GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
19568#define EXPECT_PRED2(pred, v1, v2) \
19569 GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
19570#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
19571 GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
19572#define ASSERT_PRED2(pred, v1, v2) \
19573 GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
19574
19575
19576
19577// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
19578// this in your code.
19579template <typename Pred,
19580 typename T1,
19581 typename T2,
19582 typename T3>
19583AssertionResult AssertPred3Helper(const char* pred_text,
19584 const char* e1,
19585 const char* e2,
19586 const char* e3,
19587 Pred pred,
19588 const T1& v1,
19589 const T2& v2,
19590 const T3& v3) {
19591 if (pred(v1, v2, v3)) return AssertionSuccess();
19592
19593 return AssertionFailure() << pred_text << "("
19594 << e1 << ", "
19595 << e2 << ", "
19596 << e3 << ") evaluates to false, where"
19597 << "\n" << e1 << " evaluates to " << v1
19598 << "\n" << e2 << " evaluates to " << v2
19599 << "\n" << e3 << " evaluates to " << v3;
19600}
19601
19602// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
19603// Don't use this in your code.
19604#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
19605 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
19606 on_failure)
19607
19608// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
19609// this in your code.
19610#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
19611 GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
19612 #v1, \
19613 #v2, \
19614 #v3, \
19615 pred, \
19616 v1, \
19617 v2, \
19618 v3), on_failure)
19619
19620// Ternary predicate assertion macros.
19621#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19622 GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19623#define EXPECT_PRED3(pred, v1, v2, v3) \
19624 GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19625#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19626 GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
19627#define ASSERT_PRED3(pred, v1, v2, v3) \
19628 GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
19629
19630
19631
19632// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
19633// this in your code.
19634template <typename Pred,
19635 typename T1,
19636 typename T2,
19637 typename T3,
19638 typename T4>
19639AssertionResult AssertPred4Helper(const char* pred_text,
19640 const char* e1,
19641 const char* e2,
19642 const char* e3,
19643 const char* e4,
19644 Pred pred,
19645 const T1& v1,
19646 const T2& v2,
19647 const T3& v3,
19648 const T4& v4) {
19649 if (pred(v1, v2, v3, v4)) return AssertionSuccess();
19650
19651 return AssertionFailure() << pred_text << "("
19652 << e1 << ", "
19653 << e2 << ", "
19654 << e3 << ", "
19655 << e4 << ") evaluates to false, where"
19656 << "\n" << e1 << " evaluates to " << v1
19657 << "\n" << e2 << " evaluates to " << v2
19658 << "\n" << e3 << " evaluates to " << v3
19659 << "\n" << e4 << " evaluates to " << v4;
19660}
19661
19662// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
19663// Don't use this in your code.
19664#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
19665 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
19666 on_failure)
19667
19668// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
19669// this in your code.
19670#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
19671 GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
19672 #v1, \
19673 #v2, \
19674 #v3, \
19675 #v4, \
19676 pred, \
19677 v1, \
19678 v2, \
19679 v3, \
19680 v4), on_failure)
19681
19682// 4-ary predicate assertion macros.
19683#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19684 GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19685#define EXPECT_PRED4(pred, v1, v2, v3, v4) \
19686 GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19687#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19688 GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19689#define ASSERT_PRED4(pred, v1, v2, v3, v4) \
19690 GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19691
19692
19693
19694// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
19695// this in your code.
19696template <typename Pred,
19697 typename T1,
19698 typename T2,
19699 typename T3,
19700 typename T4,
19701 typename T5>
19702AssertionResult AssertPred5Helper(const char* pred_text,
19703 const char* e1,
19704 const char* e2,
19705 const char* e3,
19706 const char* e4,
19707 const char* e5,
19708 Pred pred,
19709 const T1& v1,
19710 const T2& v2,
19711 const T3& v3,
19712 const T4& v4,
19713 const T5& v5) {
19714 if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
19715
19716 return AssertionFailure() << pred_text << "("
19717 << e1 << ", "
19718 << e2 << ", "
19719 << e3 << ", "
19720 << e4 << ", "
19721 << e5 << ") evaluates to false, where"
19722 << "\n" << e1 << " evaluates to " << v1
19723 << "\n" << e2 << " evaluates to " << v2
19724 << "\n" << e3 << " evaluates to " << v3
19725 << "\n" << e4 << " evaluates to " << v4
19726 << "\n" << e5 << " evaluates to " << v5;
19727}
19728
19729// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
19730// Don't use this in your code.
19731#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
19732 GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
19733 on_failure)
19734
19735// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
19736// this in your code.
19737#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
19738 GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
19739 #v1, \
19740 #v2, \
19741 #v3, \
19742 #v4, \
19743 #v5, \
19744 pred, \
19745 v1, \
19746 v2, \
19747 v3, \
19748 v4, \
19749 v5), on_failure)
19750
19751// 5-ary predicate assertion macros.
19752#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19753 GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19754#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
19755 GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19756#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19757 GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19758#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
19759 GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19760
19761
19762
19763#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19764
19765// Macros for testing equalities and inequalities.
19766//
19767// * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
19768// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
19769// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
19770// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
19771// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
19772// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
19773//
19774// When they are not, Google Test prints both the tested expressions and
19775// their actual values. The values must be compatible built-in types,
19776// or you will get a compiler error. By "compatible" we mean that the
19777// values can be compared by the respective operator.
19778//
19779// Note:
19780//
19781// 1. It is possible to make a user-defined type work with
19782// {ASSERT|EXPECT}_??(), but that requires overloading the
19783// comparison operators and is thus discouraged by the Google C++
19784// Usage Guide. Therefore, you are advised to use the
19785// {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
19786// equal.
19787//
19788// 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
19789// pointers (in particular, C strings). Therefore, if you use it
19790// with two C strings, you are testing how their locations in memory
19791// are related, not how their content is related. To compare two C
19792// strings by content, use {ASSERT|EXPECT}_STR*().
19793//
19794// 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
19795// {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
19796// what the actual value is when it fails, and similarly for the
19797// other comparisons.
19798//
19799// 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
19800// evaluate their arguments, which is undefined.
19801//
19802// 5. These macros evaluate their arguments exactly once.
19803//
19804// Examples:
19805//
19806// EXPECT_NE(5, Foo());
19807// EXPECT_EQ(NULL, a_pointer);
19808// ASSERT_LT(i, array_size);
19809// ASSERT_GT(records.size(), 0) << "There is no record left.";
19810
19811#define EXPECT_EQ(expected, actual) \
19812 EXPECT_PRED_FORMAT2(::testing::internal:: \
19813 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19814 expected, actual)
19815#define EXPECT_NE(expected, actual) \
19816 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
19817#define EXPECT_LE(val1, val2) \
19818 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19819#define EXPECT_LT(val1, val2) \
19820 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19821#define EXPECT_GE(val1, val2) \
19822 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19823#define EXPECT_GT(val1, val2) \
19824 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19825
19826#define GTEST_ASSERT_EQ(expected, actual) \
19827 ASSERT_PRED_FORMAT2(::testing::internal:: \
19828 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19829 expected, actual)
19830#define GTEST_ASSERT_NE(val1, val2) \
19831 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
19832#define GTEST_ASSERT_LE(val1, val2) \
19833 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19834#define GTEST_ASSERT_LT(val1, val2) \
19835 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19836#define GTEST_ASSERT_GE(val1, val2) \
19837 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19838#define GTEST_ASSERT_GT(val1, val2) \
19839 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19840
19841// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
19842// ASSERT_XY(), which clashes with some users' own code.
19843
19844#if !GTEST_DONT_DEFINE_ASSERT_EQ
19845# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
19846#endif
19847
19848#if !GTEST_DONT_DEFINE_ASSERT_NE
19849# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
19850#endif
19851
19852#if !GTEST_DONT_DEFINE_ASSERT_LE
19853# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
19854#endif
19855
19856#if !GTEST_DONT_DEFINE_ASSERT_LT
19857# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
19858#endif
19859
19860#if !GTEST_DONT_DEFINE_ASSERT_GE
19861# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
19862#endif
19863
19864#if !GTEST_DONT_DEFINE_ASSERT_GT
19865# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
19866#endif
19867
19868// C-string Comparisons. All tests treat NULL and any non-NULL string
19869// as different. Two NULLs are equal.
19870//
19871// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
19872// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
19873// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
19874// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
19875//
19876// For wide or narrow string objects, you can use the
19877// {ASSERT|EXPECT}_??() macros.
19878//
19879// Don't depend on the order in which the arguments are evaluated,
19880// which is undefined.
19881//
19882// These macros evaluate their arguments exactly once.
19883
19884#define EXPECT_STREQ(expected, actual) \
19885 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19886#define EXPECT_STRNE(s1, s2) \
19887 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19888#define EXPECT_STRCASEEQ(expected, actual) \
19889 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19890#define EXPECT_STRCASENE(s1, s2)\
19891 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19892
19893#define ASSERT_STREQ(expected, actual) \
19894 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19895#define ASSERT_STRNE(s1, s2) \
19896 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19897#define ASSERT_STRCASEEQ(expected, actual) \
19898 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19899#define ASSERT_STRCASENE(s1, s2)\
19900 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19901
19902// Macros for comparing floating-point numbers.
19903//
19904// * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
19905// Tests that two float values are almost equal.
19906// * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
19907// Tests that two double values are almost equal.
19908// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
19909// Tests that v1 and v2 are within the given distance to each other.
19910//
19911// Google Test uses ULP-based comparison to automatically pick a default
19912// error bound that is appropriate for the operands. See the
19913// FloatingPoint template class in gtest-internal.h if you are
19914// interested in the implementation details.
19915
19916#define EXPECT_FLOAT_EQ(expected, actual)\
19917 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19918 expected, actual)
19919
19920#define EXPECT_DOUBLE_EQ(expected, actual)\
19921 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19922 expected, actual)
19923
19924#define ASSERT_FLOAT_EQ(expected, actual)\
19925 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19926 expected, actual)
19927
19928#define ASSERT_DOUBLE_EQ(expected, actual)\
19929 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19930 expected, actual)
19931
19932#define EXPECT_NEAR(val1, val2, abs_error)\
19933 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19934 val1, val2, abs_error)
19935
19936#define ASSERT_NEAR(val1, val2, abs_error)\
19937 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19938 val1, val2, abs_error)
19939
19940// These predicate format functions work on floating-point values, and
19941// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
19942//
19943// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
19944
19945// Asserts that val1 is less than, or almost equal to, val2. Fails
19946// otherwise. In particular, it fails if either val1 or val2 is NaN.
19947GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
19948 float val1, float val2);
19949GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
19950 double val1, double val2);
19951
19952
19953#if GTEST_OS_WINDOWS
19954
19955// Macros that test for HRESULT failure and success, these are only useful
19956// on Windows, and rely on Windows SDK macros and APIs to compile.
19957//
19958// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
19959//
19960// When expr unexpectedly fails or succeeds, Google Test prints the
19961// expected result and the actual result with both a human-readable
19962// string representation of the error, if available, as well as the
19963// hex result code.
19964# define EXPECT_HRESULT_SUCCEEDED(expr) \
19965 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19966
19967# define ASSERT_HRESULT_SUCCEEDED(expr) \
19968 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19969
19970# define EXPECT_HRESULT_FAILED(expr) \
19971 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19972
19973# define ASSERT_HRESULT_FAILED(expr) \
19974 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19975
19976#endif // GTEST_OS_WINDOWS
19977
19978// Macros that execute statement and check that it doesn't generate new fatal
19979// failures in the current thread.
19980//
19981// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
19982//
19983// Examples:
19984//
19985// EXPECT_NO_FATAL_FAILURE(Process());
19986// ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
19987//
19988#define ASSERT_NO_FATAL_FAILURE(statement) \
19989 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
19990#define EXPECT_NO_FATAL_FAILURE(statement) \
19991 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
19992
19993// Causes a trace (including the source file path, the current line
19994// number, and the given message) to be included in every test failure
19995// message generated by code in the current scope. The effect is
19996// undone when the control leaves the current scope.
19997//
19998// The message argument can be anything streamable to std::ostream.
19999//
20000// In the implementation, we include the current line number as part
20001// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
20002// to appear in the same block - as long as they are on different
20003// lines.
20004#define SCOPED_TRACE(message) \
20005 ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
20006 __FILE__, __LINE__, ::testing::Message() << (message))
20007
20008// Compile-time assertion for type equality.
20009// StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
20010// the same type. The value it returns is not interesting.
20011//
20012// Instead of making StaticAssertTypeEq a class template, we make it a
20013// function template that invokes a helper class template. This
20014// prevents a user from misusing StaticAssertTypeEq<T1, T2> by
20015// defining objects of that type.
20016//
20017// CAVEAT:
20018//
20019// When used inside a method of a class template,
20020// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
20021// instantiated. For example, given:
20022//
20023// template <typename T> class Foo {
20024// public:
20025// void Bar() { testing::StaticAssertTypeEq<int, T>(); }
20026// };
20027//
20028// the code:
20029//
20030// void Test1() { Foo<bool> foo; }
20031//
20032// will NOT generate a compiler error, as Foo<bool>::Bar() is never
20033// actually instantiated. Instead, you need:
20034//
20035// void Test2() { Foo<bool> foo; foo.Bar(); }
20036//
20037// to cause a compiler error.
20038template <typename T1, typename T2>
20039bool StaticAssertTypeEq() {
20040 (void)internal::StaticAssertTypeEqHelper<T1, T2>();
20041 return true;
20042}
20043
20044// Defines a test.
20045//
20046// The first parameter is the name of the test case, and the second
20047// parameter is the name of the test within the test case.
20048//
20049// The convention is to end the test case name with "Test". For
20050// example, a test case for the Foo class can be named FooTest.
20051//
20052// The user should put his test code between braces after using this
20053// macro. Example:
20054//
20055// TEST(FooTest, InitializesCorrectly) {
20056// Foo foo;
20057// EXPECT_TRUE(foo.StatusIsOK());
20058// }
20059
20060// Note that we call GetTestTypeId() instead of GetTypeId<
20061// ::testing::Test>() here to get the type ID of testing::Test. This
20062// is to work around a suspected linker bug when using Google Test as
20063// a framework on Mac OS X. The bug causes GetTypeId<
20064// ::testing::Test>() to return different values depending on whether
20065// the call is from the Google Test framework itself or from user test
20066// code. GetTestTypeId() is guaranteed to always return the same
20067// value, as it always calls GetTypeId<>() from the Google Test
20068// framework.
20069#define GTEST_TEST(test_case_name, test_name)\
20070 GTEST_TEST_(test_case_name, test_name, \
20071 ::testing::Test, ::testing::internal::GetTestTypeId())
20072
20073// Define this macro to 1 to omit the definition of TEST(), which
20074// is a generic name and clashes with some other libraries.
20075#if !GTEST_DONT_DEFINE_TEST
20076# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
20077#endif
20078
20079// Defines a test that uses a test fixture.
20080//
20081// The first parameter is the name of the test fixture class, which
20082// also doubles as the test case name. The second parameter is the
20083// name of the test within the test case.
20084//
20085// A test fixture class must be declared earlier. The user should put
20086// his test code between braces after using this macro. Example:
20087//
20088// class FooTest : public testing::Test {
20089// protected:
20090// virtual void SetUp() { b_.AddElement(3); }
20091//
20092// Foo a_;
20093// Foo b_;
20094// };
20095//
20096// TEST_F(FooTest, InitializesCorrectly) {
20097// EXPECT_TRUE(a_.StatusIsOK());
20098// }
20099//
20100// TEST_F(FooTest, ReturnsElementCountCorrectly) {
20101// EXPECT_EQ(0, a_.size());
20102// EXPECT_EQ(1, b_.size());
20103// }
20104
20105#define TEST_F(test_fixture, test_name)\
20106 GTEST_TEST_(test_fixture, test_name, test_fixture, \
20107 ::testing::internal::GetTypeId<test_fixture>())
20108
20109} // namespace testing
20110
20111// Use this function in main() to run all tests. It returns 0 if all
20112// tests are successful, or 1 otherwise.
20113//
20114// RUN_ALL_TESTS() should be invoked after the command line has been
20115// parsed by InitGoogleTest().
20116//
20117// This function was formerly a macro; thus, it is in the global
20118// namespace and has an all-caps name.
20119int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
20120
20121inline int RUN_ALL_TESTS() {
20122 return ::testing::UnitTest::GetInstance()->Run();
20123}
20124
20125#endif // GTEST_INCLUDE_GTEST_GTEST_H_
20126